Linux 宝塔面板二级反代

location /baidu/ #二级目录 https://www.cmliu.net/baidu {
proxy_redirect off;
proxy_pass http://www.baidu.com/; #https与http要分清,最后的/一定不能少
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host www.baidu.com; #发送域名 默认原域名就用$http_host
proxy_read_timeout 300s;
# Show realip in v2ray access.log
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh)

效果如下 https://www.cmliu.net/baidu

发表评论

邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据