编辑nginx.conf文件,在 “http {” 和对应的 “}” 中间添加服务
注意 :正向代理服务貌似不能以虚拟机的形式添加在“conf.d”和“sites-enabled”文件夹里,不然不生效
#HTTP
server{
resolver 114.114.114.114;
access_log /var/log/nginx/access_proxy.log main;
listen 80;
location / {
root html;
index index.html index.htm;
proxy_pass $scheme://$host$request_uri;
proxy_set_header HOST $http_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;
}
} Linux学习,http:// linux.it.net.cn