分享几个nginx配置文件(没有fpm配置)
举报
仙士可
发表于 2023/06/21 17:31:39
2023/06/21
【摘要】 1950编辑删除单swoole反向代理配置server{ listen 80; server_name 域名(空格分隔可多个); location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md) { return 404; } client_max_bod...
单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";
}
}
复制
推荐
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
评论(0)