nginx 301 跳转
Linux 2024/10/11 11:55:38 点击:不统计
nginx配置 域名对应的 路径进行跳转,包括http跳转https
直接看nginx 配置
代码
server {
listen 80;
server_name atlas.deepbi.com;
# http跳转https
location / {
return 301 https://$host$request_uri;
}
# 指定uri 跳转
location /guanliyuan/ {
return 301 https://www.forasp.cn$request_uri;
}
# 指定页面跳转
location / {
alias /opt/dist_online/; # 另外指定root根目录路径
index index.html; # 页面中设置跳转
try_files $uri $uri/ /guanliyuan/index.html;
}
}
代码结束·上一篇:nginx设置拒绝服务 >> ·下一篇:ubuntu mysql 无法连接3306端口 >>