forked from slsfi/digital-edition-frontend-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
45 lines (38 loc) · 1.39 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
upstream nodejs {
server web:4201;
}
server {
listen 80;
# Enable sending precompressed ".gz" versions of static files if such exist.
# The precompressed files are created when the app is built.
# https://nginx.org/en/docs/http/ngx_http_gzip_static_module.html
gzip_static on;
# Configure compression of proxied requests.
# https://nginx.org/en/docs/http/ngx_http_gzip_module.html#gzip_proxied
gzip_proxied no-cache no-store private expired auth;
# Uncomment the gzip directives below to enable on-the-fly gzip compression
# of html dynamically generated by server-side rendering. Enabling will
# increase server load, but significantly reduce the size of transfered html
# files, even on the lowest compression level (1).
# https://nginx.org/en/docs/http/ngx_http_gzip_module.html
#gzip on;
#gzip_comp_level 1;
#gzip_types text/html;
root /static;
location / {
try_files $uri sv/$uri @backend;
}
location @backend {
proxy_pass http://nodejs;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_cache_bypass $http_upgrade;
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
}
}