diff --git a/Miscellaneous/api.md b/Miscellaneous/api.md new file mode 100644 index 0000000..8c14bb8 --- /dev/null +++ b/Miscellaneous/api.md @@ -0,0 +1 @@ +https://widget.seniverse.com/api/weather?&geolocation=enabled \ No newline at end of file diff --git a/Miscellaneous/nginx.conf b/Miscellaneous/nginx.conf new file mode 100644 index 0000000..2ed68f0 --- /dev/null +++ b/Miscellaneous/nginx.conf @@ -0,0 +1,120 @@ +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 + listen 443 ssl http2; #填写绑定证书的域名 + server_name qr.powerrain.cn; + #证书文件名称 + ssl_certificate 1_qr.powerrain.cn_bundle.crt; + #私钥文件名称 + ssl_certificate_key 2_qr.powerrain.cn.key; + ssl_session_timeout 5m; + #请按照这个协议配置 + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + #请按照这个套件配置,配置加密套件,写法遵循 openssl 标准。 + ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; + ssl_prefer_server_ciphers on; + location / { + proxy_pass http://127.0.0.1:5000; + } +} + +server { + listen 80; + server_name 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; + } +} + +server { + #SSL 访问端口号为 443 + listen 443 ssl http2; #填写绑定证书的域名 + server_name yb.powerrain.cn; + #证书文件名称 + ssl_certificate 1_yb.powerrain.cn_bundle.crt; + #私钥文件名称 + ssl_certificate_key 2_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; + } +} + + + + + + #开启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