配置

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
server {
listen 443 ssl;
server_name own.liukewen.cn;
#root /usr/share/nginx/html;

# Load configuration files for the default server block.
ssl_certificate /etc/nginx/cret/own.liukewen.cn.pem;
ssl_certificate_key /etc/nginx/cret/own.liukewen.cn.key;

ssl_session_cache shared:SSL:10m;
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 TLSv1.3;

ssl_prefer_server_ciphers on;


location / {
root /root/own/web/dist;

#设置虚拟主机默认访问的网页
index index.html index.htm;
}
location ^~ /api/ {
rewrite "^/api/(.*)$" /$1 break;
proxy_pass http://localhost:8082;
proxy_http_version 1.1; #...............http......
proxy_set_header Host $host; #header............host......
proxy_set_header X-Real-IP $remote_addr; # header..................IP......
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # ..................
}

error_page 404 /404.html;
location = /404.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}