-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.conf
59 lines (51 loc) · 1.72 KB
/
default.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
52
53
54
55
56
57
58
gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
gzip_types
application/javascript
application/json
application/x-font-ttf
application/xml
font/opentype
image/bmp
image/svg+xml
image/x-icon
text/css
text/plain;
proxy_cache_path /var/tmp/cache levels=1:2 keys_zone=STATIC:10m inactive=24h;
server {
listen 80;
listen [::]:80;
server_name localhost;
root /usr/share/nginx/html;
if ($http_x_forwarded_proto = "http") {
return 301 https://$host$request_uri;
}
location /api {
rewrite ^/api/(.*) /$1 break;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_pass http://localhost:5000;
}
# location /config.js {
# rewrite ^/api/config.js /config.js break;
# add_header Cache-Control "max-age=1800, public";
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-Host $host;
# proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie;
# proxy_buffering on;
# proxy_cache STATIC;
# proxy_cache_valid 200 206 1d;
# proxy_cache_valid any 60m;
# proxy_cache_use_stale error timeout invalid_header updating
# http_500 http_502 http_503 http_504;
# proxy_pass http://localhost:5000;
# }
location / {
try_files $uri $uri/ /index.html;
}
}