diff --git a/Miscellaneous/nginx.conf b/Miscellaneous/nginx.conf index 2ed68f0..17e3c4a 100644 --- a/Miscellaneous/nginx.conf +++ b/Miscellaneous/nginx.conf @@ -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 { #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 -gzip on; -#压缩阀值,小于1k不压缩 -gzip_min_length 1k; -gzip_buffers 4 16k; -#gzip_http_version 1.0; -#压缩级别 -gzip_comp_level 5; -#压缩的文件类型 -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; -#IE6对Gzip不怎么友好,禁止IE6进行压缩 -gzip_disable "MSIE [1-6]\."; \ No newline at end of file +server { + #SSL 访问端口号为 443 + listen 443 ssl http2; #填写绑定证书的域名 + server_name m.yb.powerrain.cn; + #证书文件名称 + ssl_certificate 1_m.yb.powerrain.cn_bundle.crt; + #私钥文件名称 + ssl_certificate_key 2_m.yb.powerrain.cn.key; + ssl_session_timeout 5m; + #请按照这个协议配置 + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + + 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; + } +}