worker_processes 1;

events { worker_connections 1024; }

http { server { listen 127.0.0.1:12345; server_name localhost;

    location / {
        proxy_pass http://example.com;
        proxy_set_header Host example.com;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        sub_filter 'location' ';';
        sub_filter_once on;
    }
}

}

写一个nginxconf监听12700112345反代 examplecom需要设置host等请求头并把页面返回中的关键词location全替换成;

原文地址: https://www.cveoy.top/t/topic/dWBf 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录