openreplay/scripts/dockerfiles/nginx/location.list
rjshrjndrn 7126aa43dc chore(nginx): support for env variable
API_ENDPOINT will point to chalice endpoint
FRONTEND_ENDPOINT will point to frontend endpoint

Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
2022-08-07 12:47:52 +02:00

28 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_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
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_set_header Host $http_host;
proxy_pass $target;
}