单swoole反向代理配置
server { listen 80; server_name 域名(空格分隔可多个); location ~ ^/(\\.user.ini|\\.htaccess|\\.git|\\.svn|\\.project|LICENSE|README.md) { return 404; } client\_max\_body_size 20m; location / { proxy\_pass\_request_body on; proxy\_pass\_request_headers on; proxy_pass 代理地址:端口号; proxy\_http\_version 1.1; proxy\_set\_header Upgrade $http_upgrade;# 支持ws proxy\_set\_header Connection "Upgrade";#支持ws } }
ssl swoole反向代理
server { listen 443 ssl http2; server_name 域名; ssl_certificate /ssl.pem证书地址; ssl\_certificate\_key /ssl.key证书key地址; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; ssl\_prefer\_server_ciphers on; ssl\_session\_cache shared:SSL:10m; ssl\_session\_timeout 10m; location ~ ^/(\\.user.ini|\\.htaccess|\\.git|\\.svn|\\.project|LICENSE|README.md) { return 404; } client\_max\_body_size 20m; location / { proxy_pass 代理地址:端口号; proxy\_http\_version 1.1; proxy\_set\_header Upgrade $http_upgrade; proxy\_set\_header Connection "Upgrade"; } } server { listen 80; server_name 域名; location / { rewrite ^/(.*)$ https://域名/$1 permanent;##由http自动跳转到https } }
vue代理网站
server { listen 80; server_name 域名(空格分隔可多个); location ~ ^/(\\.user.ini|\\.htaccess|\\.git|\\.svn|\\.project|LICENSE|README.md) { return 404; } client\_max\_body_size 20m; location / { try_files $uri $uri/ @rewrites; } location @rewrites { rewrite ^(.+)$ /index.html last; } location ~* \\.(?:htm|html)$ { add_header Cache-Control "private, no-store, no-cache, must-revalidate"; } location ~* \\.(?:ico|css|js|gif|jpe?g|png|svg|ttf|woff|eot|crx)$ { expires max; add_header Pragma public; add_header Cache-Control "public, must-revalidate, proxy-revalidate"; } }