openreplay/scripts/dockerfiles/nginx/location.list
rjshrjndrn e856982d6d chore(nginx): using header same as the target service
Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
2022-08-17 19:58:17 +02:00

32 lines
786 B
Text

location ~* /general_stats {
deny all;
}
location /healthz {
return 200 'OK';
}
location /api/ {
set $target $api_endpoint;
rewrite ^/api/(.*) /$1 break;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass $target;
}
location / {
set $target $frontend_endpoint;
include /etc/nginx/conf.d/compression.conf;
index /index.html;
rewrite ^((?!.(js|css|png|svg|jpg|woff|woff2)).)*$ /index.html break;
proxy_intercept_errors on; # see frontend://nginx.org/en/docs/frontend/ngx_frontend_proxy_module.html#proxy_intercept_errors
error_page 404 =200 /index.html;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass $target;
}