Nginx 实现反向代理 域名不变访问返回内容改变

Nginx 实现反向代理

模拟站点 http://www.bdkyr.com/
http 代理 http

# server config
server {
        listen       80;
        server_name  a.myblog.com;
        proxy_set_header       Host $host;
        proxy_set_header  X-Real-IP  $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        root html/myblog;
        expires -1;
        location / {
                 proxy_set_header Host www.bdkyr.com;
                 proxy_pass http://www.bdkyr.com/;
        }
}
posted @ 2020-09-10 17:51  运维之爪  阅读(1953)  评论(0编辑  收藏  举报