hestiacp custom config for api.krishit.com
Best Solution: Create a Custom Proxy Template Instead of modifying the generated config, create your own template. 1. Copy the existing templates cd /usr/local/hestia/data/templates/web/nginx cp default.tpl api-node.tpl cp default.stpl api-node.stpl 2. Edit api-node.stpl Replace this: location / { proxy_ssl_server_name on; proxy_ssl_name $host; proxy_pass https://%ip%:8443; } with: location / { if ($request_method = OPTIONS) { add_header Access-Control-Allow-Origin "https://hrms.krishit.com" always; add_header Access-Control-Allow-Credentials "true" always; add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS" always; add_header Access-Control-Allow-Headers "Authorization, Content-Type, Accept, Origin, X-Requested-With" always; return 204; } ...