http 代理
server {
listen 88; #监听端口
resolver 8.8.8.8; #dns解析地址
server_name _;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_pass https://$host$request_uri; #设定http代理服务器的协议和地址
proxy_set_header HOST $host;
proxy_buffers 256 4k;
proxy_max_temp_file_size 0k;
proxy_connect_timeout 30;
proxy_send_timeout 60;
proxy_read_timeout 60;
proxy_next_upstream error timeout invalid_header http_502;
#root html;
#index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
https 代理
server {
resolver 8.8.8.8; #dns解析地址
listen 89; #代理监听端口
proxy_connect;
proxy_connect_allow 443 563;
location / {
proxy_pass https://$host$request_uri; #设定https代理服务器的协议和地址
proxy_set_header HOST $host;
proxy_buffers 256 4k;
proxy_max_temp_file_size 0k;
proxy_connect_timeout 30;
proxy_send_timeout 60;
proxy_read_timeout 60;
proxy_next_upstream error timeout invalid_header http_502;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
重启nginx