diff --git a/etc/nginx/conf.d/deskpro_messenger_server_params b/etc/nginx/conf.d/deskpro_messenger_server_params index 24251fb..5d77cca 100644 --- a/etc/nginx/conf.d/deskpro_messenger_server_params +++ b/etc/nginx/conf.d/deskpro_messenger_server_params @@ -18,3 +18,27 @@ location ^~ /sys/services/messenger-api/ { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } + +location ~ ^/deskpro-messenger/app/assets/ { + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Headers' '*'; + add_header 'Access-Control-Allow-Methods' 'GET,OPTIONS'; + add_header 'Access-Control-Max-Age' '1728000'; + add_header 'Cache-Control' 'public, max-age=31536000, immutable'; + + if ($request_method = 'OPTIONS') { + add_header 'Content-Type' 'text/plain charset=UTF-8'; + add_header 'Content-Length' 0; + return 204; + } +} + +location ^~ /firebase-messaging-sw.js { + fastcgi_pass unix:/run/php_fpm_dp_default.sock; + include /etc/nginx/conf.d/deskpro_fastcgi_params; +} + +location ~ ^/deskpro-messenger/ { + fastcgi_pass unix:/run/php_fpm_dp_default.sock; + include /etc/nginx/conf.d/deskpro_fastcgi_params; +} diff --git a/etc/nginx/conf.d/deskpro_server_params b/etc/nginx/conf.d/deskpro_server_params index 6209904..a233c24 100644 --- a/etc/nginx/conf.d/deskpro_server_params +++ b/etc/nginx/conf.d/deskpro_server_params @@ -76,11 +76,6 @@ location ^~ /static/ { } } -location ^~ /firebase-messaging-sw.js { - fastcgi_pass unix:/run/php_fpm_dp_default.sock; - include /etc/nginx/conf.d/deskpro_fastcgi_params; -} - location ~ ^/horizon\-ui/app/assets/ { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Headers' '*'; @@ -94,32 +89,3 @@ location ~ ^/horizon\-ui/app/assets/ { return 204; } } - -location ~ ^/deskpro-messenger/app/assets/ { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Headers' '*'; - add_header 'Access-Control-Allow-Methods' 'GET,OPTIONS'; - add_header 'Access-Control-Max-Age' '1728000'; - add_header 'Cache-Control' 'public, max-age=31536000, immutable'; - - if ($request_method = 'OPTIONS') { - add_header 'Content-Type' 'text/plain charset=UTF-8'; - add_header 'Content-Length' 0; - return 204; - } -} - -location ~ ^/deskpro-messenger/ { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Headers' '*'; - add_header 'Access-Control-Allow-Methods' 'GET,OPTIONS'; - add_header 'Access-Control-Max-Age' '1728000'; - add_header 'Cache-Control' 'public, max-age=31536000, immutable'; - - if ($request_method = 'OPTIONS') { - add_header 'Content-Type' 'text/plain charset=UTF-8'; - add_header 'Content-Length' 0; - return 204; - } - try_files $uri $uri/ /deskpro-messenger/index.html; -}