实现案例:
将https://www.test.com反代源站 https://www.itkylin.com
即访问https://www.test.com自动获取https://www.itkylin.com的内容
实现代码如下:
server
{
listen 80;
server_name www.test.com;
location / {
proxy_pass https://www.itkylin.com/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}