diff --git a/etc/nginx/conf.d/deskpro_server_params.tmpl b/etc/nginx/conf.d/deskpro_server_params.tmpl index ca2a8de..930c324 100644 --- a/etc/nginx/conf.d/deskpro_server_params.tmpl +++ b/etc/nginx/conf.d/deskpro_server_params.tmpl @@ -46,22 +46,26 @@ location ^~ /api/ { } location ^~ /sys/services/messenger-api/ { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Headers' '*'; - add_header 'Access-Control-Max-Age' '1728000'; if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Headers' '*'; + add_header 'Access-Control-Max-Age' '1728000'; add_header 'Content-Type' 'text/plain charset=UTF-8'; add_header 'Content-Length' 0; return 204; } + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Headers' '*'; + add_header 'Access-Control-Max-Age' '1728000'; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; {{if getenv "HTTP_USER_REAL_PROTO_HEADER"}} - proxy_set_header X-Forwarded-Proto $http_{{ (getenv "HTTP_USER_REAL_PROTO_HEADER") | toLower | replaceAll "-" "_" }}; + proxy_set_header X-Forwarded-Proto $http_{{ (getenv "HTTP_USER_REAL_PROTO_HEADER") | toLower | replaceAll "-" "_" }}; {{else}} - proxy_set_header X-Forwarded-Proto $proto_for_scheme; + proxy_set_header X-Forwarded-Proto $proto_for_scheme; {{end}} {{if getenv "HTTP_USER_REAL_HOST_HEADER"}}