update nginx.conf

This commit is contained in:
RainSun 2019-11-28 00:00:09 +08:00
parent 1888582404
commit 1aaab86ff6

View File

@ -1,38 +1,3 @@
server {
listen 80;
server_name powerrain.cn localhost;
location / {
root /data/wwwroot;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /data/wwwroot;
}
}
server {
#SSL 访问端口号为 443
listen 443 ssl http2; #填写绑定证书的域名
server_name powerrain.cn;
#证书文件名称
ssl_certificate 1_powerrain.cn_bundle.crt;
#私钥文件名称
ssl_certificate_key 2_powerrain.cn.key;
ssl_session_timeout 5m;
#请按照这个协议配置
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
location / {
root /data/wwwroot;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /data/wwwroot;
}
}
server { server {
#SSL 访问端口号为 443 #SSL 访问端口号为 443
@ -101,20 +66,86 @@ server {
} }
} }
server {
listen 80;
server_name m.yb.powerrain.cn;
location / {
root /data/yiban/yiban;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /api {
proxy_pass http://127.0.0.1:8000;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /data/wwwroot;
}
}
#开启gzip server {
gzip on; #SSL 访问端口号为 443
#压缩阀值小于1k不压缩 listen 443 ssl http2; #填写绑定证书的域名
gzip_min_length 1k; server_name m.yb.powerrain.cn;
gzip_buffers 4 16k; #证书文件名称
#gzip_http_version 1.0; ssl_certificate 1_m.yb.powerrain.cn_bundle.crt;
#压缩级别 #私钥文件名称
gzip_comp_level 5; ssl_certificate_key 2_m.yb.powerrain.cn.key;
#压缩的文件类型 ssl_session_timeout 5m;
gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png application/javascript; #请按照这个协议配置
gzip_vary off; ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#IE6对Gzip不怎么友好禁止IE6进行压缩
gzip_disable "MSIE [1-6]\."; location / {
root /data/yiban/yiban;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /api {
proxy_pass http://127.0.0.1:8000;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /data/wwwroot;
}
}
server {
listen 80;
server_name powerrain.cn localhost;
location / {
root /data/wwwroot;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /data/wwwroot;
}
}
server {
#SSL 访问端口号为 443
listen 443 ssl http2; #填写绑定证书的域名
server_name powerrain.cn;
#证书文件名称
ssl_certificate 1_powerrain.cn_bundle.crt;
#私钥文件名称
ssl_certificate_key 2_powerrain.cn.key;
ssl_session_timeout 5m;
#请按照这个协议配置
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
location / {
root /data/wwwroot;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /data/wwwroot;
}
}