美文网首页
nginx代理访问其他路由不跳转

nginx代理访问其他路由不跳转

作者: Chting | 来源:发表于2024-03-31 09:44 被阅读0次
server {
    listen       80;
    server_name  dev.baidu.com;
    root   /var/www/html/wwwroot/testbaidu;
    index  index.php index.html index.htm;


    location /baidu {
        proxy_pass https://www.baidu.com/;
        proxy_set_header Host "www.baidu.com";
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Port $server_port;
        # proxy_redirect off;
        proxy_redirect default;
        proxy_ignore_client_abort on;
    }
}

相关文章

网友评论

      本文标题:nginx代理访问其他路由不跳转

      本文链接:https://www.haomeiwen.com/subject/orgvtjtx.html