location /coditech/ { proxy_pass http://127.0.0.1:38500/; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; # CORS for public (no credentials) add_header Access-Control-Allow-Origin * always; add_header Access-Control-Allow-Methods GET,POST,OPTIONS always; add_header Access-Control-Allow-Headers Origin,Content-Type,Accept,Authorization always; # Preflight if ($request_method = OPTIONS) { add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods GET,POST,OPTIONS; add_header Access-Control-Allow-Headers Origin,Content-Type,Accept,Authorization; add_header Access-Control-Max-Age 1728000; add_header Content-Length 0; return 204; } }