-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.prod.conf
49 lines (38 loc) · 1.23 KB
/
nginx.prod.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
root /srv/blog/www;
index index.js index.html index.htm;
server {
listen 80;
server_name www.xiaodongli.me xiaodongli.me;
rewrite ^(.*)$ https://$host$1 permanent;
}
server {
listen 443 ssl;
server_name www.xiaodongli.me xiaodongli.me;
set $node_port 8360;
ssl_certificate /etc/letsencrypt/live/www.xiaodongli.me/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.xiaodongli.me/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
if ( -f $request_filename/index.html ){
rewrite (.*) $1/index.html break;
}
if ( !-f $request_filename ){
rewrite (.*) /index.js;
}
location = /index.js {
resolver 127.0.0.11;
proxy_http_version 1.1;
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_set_header X-NginX-Proxy true;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://node:$node_port$request_uri;
proxy_redirect off;
}
location ~ /static/ {
etag on;
expires max;
}
}