单swoole反向代理配置
代码语言:javascript复制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反向代理
代码语言:javascript复制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代理网站
代码语言:javascript复制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";
}
}
本文为仙士可原创文章,转载无需和我联系,但请注明来自仙士可博客www.php20.cn
- 上一篇: 没有了
- 下一篇: 搭建自用git服务器