This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.nginx.conf
76 lines (61 loc) · 2.15 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
server
{
listen 80;
server_name life.hokori.online;
index index.html index.htm index.php;
location / {
rewrite ^(.*)$ https://$host$1 permanent;
}
}
server
{
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name life.hokori.online;
ssl_certificate cert/life.hokori.online.pem;
ssl_certificate_key cert/life.hokori.online.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
index index.html index.htm index.php;
root /www/wwwroot/life.hokori.online/frontend/build;
location / {
try_files $uri /index.html
root /www/wwwroot/life.hokori.online/frontend/build;
}
# backend
location /api {
proxy_pass http://localhost:8007;
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-Host $http_host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header cache-control 'no-store';
proxy_set_header If-None-Match '1';
proxy_cache_bypass $http_upgrade;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|mp3)$ {
expires 30d;
}
location ~ .*\.(js|css)?$ {
expires 12h;
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ /\.ht {
deny all;
}
access_log /www/wwwlogs/access.log;
}