-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
51 lines (36 loc) · 1.42 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
46
47
48
49
50
51
server {
root /opt/deployments/hermes-packages/hermes-packages-www/dist/hermes-packages-web;
index index.html;
location / {
# Try to serve static files first, else fallback to index.html
try_files $uri $uri/ /index.html;
}
location /socket.io/ {
proxy_pass http://localhost:8090;
proxy_redirect off;
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-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api {
try_files $uri $uri/ @api;
}
# Api backend
location @api {
proxy_pass http://localhost:8090;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-HTTPS-Protocol $ssl_protocol;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # Non-standard de-facto
proxy_set_header X-Forwarded-Host $remote_addr;
proxy_set_header X-Forwarded-Proto $ssl_protocol; # we are using only https
proxy_set_header Forwarded $proxy_add_x_forwarded_for; # standardized way
proxy_set_header Host $http_host;
rewrite ^(.*)$ $1 break;
rewrite_log on;
return 403;
}
}