常用Nginx Server配置模板

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
server {
listen 1225;
server_name tencent.xing-z.com;

client_max_body_size 800m;
proxy_connect_timeout 600;
proxy_read_timeout 600;
proxy_send_timeout 600;

ssl on;
ssl_certificate /home/ubuntu/.acme.sh/tencent.xing-z.com/tencent.xing-z.com.cer;
ssl_certificate_key /home/ubuntu/.acme.sh/tencent.xing-z.com/tencent.xing-z.com.key;

#ssl_session_cache shared:SSL:1m;
#ssl_session_timeout 5m;
#ssl_prefer_server_ciphers on;
#ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

location / {
proxy_pass http://127.0.0.1:41225;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Nginx-Proxy true;

proxy_redirect off;
}
}