本帖最后由 image 于 2022-7-5 09:07 编辑
在反代服务器上修改vhost
- server {
- listen 80;
- listen 443; #如有必要
- server_name a.xxx.com; #原本服务器的域名, 现已解析到反代服务器
-
-
-
- location / {
- proxy_pass http://a.a.a.a:8080; #或者80 在原服务器查看 SSL的话: https://a.a.a.a:443
- proxy_set_header Host a.xxx.com; #原服务器绑定域名
- proxy_set_header Accept-Encoding ”;
- proxy_set_header X-Forwarded-By $server_addr:$server_port;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Request-ID $request_id;
-
- proxy_intercept_errors off;
-
- proxy_pass_request_headers on;
- proxy_pass_request_body on;
- }
- }
复制代码
重启服务 systemctl restart nginx |