Mcmc使用Nginx去掉默认html目录
编辑
27
2024-01-11
server {
listen 80;
server_name xiaoming728.com;
# index.html fallback
absolute_redirect off;
gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
gzip_types application/javascript application/json application/xml text/css text/plain text/xml text/javascript;
location ~ ^/(ms|login|cms|basic|mdiy|template|static|upload) {
client_max_body_size 1000m;
proxy_pass http://127.0.0.1:8081;
proxy_redirect default;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache_bypass $http_upgrade;
proxy_next_upstream error timeout invalid_header http_500;
}
location /zh {
alias /opt/soft/docker/mcms/zh;
autoindex on;
try_files $uri $uri /zh/index.html;
}
location ^~ /en {
rewrite ^/en(/.*)?$ https://xiaoming728.com$1 permanent;
}
location = /sitemap.xml {
alias /opt/soft/docker/mcms/config/sitemap.xml;
}
location = /robots.txt {
alias /opt/soft/docker/mcms/config/robots.txt;
}
location / {
alias /opt/soft/docker/mcms/en/;
autoindex on;
try_files $uri $uri/ /en/index.html =404;
}
}
- 0
- 0
-
赞助
赞赏 -
分享