目 录CONTENT

文章目录
VPS

HestiaCP面板反向代理其他网站设置

阿尘Joueur
2022-08-06 / 0 评论 / 5 点赞 / 350 阅读 / 212 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2024-03-11,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。
广告 广告

服务器推荐:

点击直达 腾讯云服务器
点击直达 海外服务器
点击直达 阿里云服务器

cd /home/用户名/conf/web/你新建的域名

vim nginx.ssl.conf
注释掉图中内容(注释用#号)

image-20220618122725389

如下图

img

在注释代码上方加以下代码(自行修改IP+端口号)

location / {
  proxy_pass http://IP:端口号/;
  rewrite ^/(.*)$ /$1 break;
  proxy_redirect off;
  proxy_set_header Host $host;
  proxy_set_header X-Forwarded-Proto $scheme;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header Upgrade-Insecure-Requests 1;
  proxy_set_header X-Forwarded-Proto https;
}

重新加载

nginx -s reload

如出现错误

nginx:[warn] cloud not build optimal proxy_headers_hash…

解决办法

编辑vim /etc/nginx/nginx.conf,在http里面增加

proxy_headers_hash_max_size 51200;
proxy_headers_hash_bucket_size 6400;

最后重新加载即可
nginx -s reload

5
广告 广告

评论区