服务器端:
server {
resolver 8.8.8.8;
resolver_timeout 5s;
listen 0.0.0.0:8888;
access_log /usr/local/nginx/logs/proxy.access.log;
error_log /usr/local/nginx/logs/proxy.error.log;
location / {
proxy_pass $scheme://$host$request_uri;
proxy_set_header Host $http_host;
proxy_buffers 256 4k;
proxy_max_temp_file_size 0;
proxy_connect_timeout 30;
proxy_cache_valid 200 302 10m;
proxy_cache_valid 301 1h;
proxy_cache_valid any 1m;
}
}
客户端:
vim /root/.bashrc
export http_proxy=http://正向代理IP地址:8888/