server {
listen 80;
server_name localhost;
location / {
root /ect/share/nginx/html;
index index.html index.htm;
}
#反向代理设置test.html跳转到http:xxxx:xx/test.html
location ~/test.html$ {
proxy_pass http://代理地址;
proxy_redirect default;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_connect_timeout 30;
proxy_send_timeout 60;
proxy_read_timeout 60;
proxy_buffer_size 32k;
proxy_buffering on;
proxy_buffers 4 128k;
proxy_busy_buffers_size 256k;
proxy_max_temp_file_size 256k;
}
#正向代理设置
resolver 8.8.8.8;
location / {
proxy_pass http://$http_host$request_url;
}
}