欢迎来到天天文库
浏览记录
ID:11914819
大小:28.00 KB
页数:6页
时间:2018-07-14
《windows下nginx_反向代理配置方法》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、Windows下Nginx_反向代理配置方法1.编辑C:ginxconfginx.conf添加修改以下内容:#usernobody;worker_processes1;error_loglogs/error.log;#error_loglogs/error.lognotice;#error_loglogs/error.loginfo;pidlogs/nginx.pid;events{worker_connections64;}http{includemime.types;default_typeapplication/octet-stream;log_form
2、atmain'$remote_addr-$remote_user[$time_local]$request'#'"$status"$body_bytes_sent"$http_referer"'#'"$http_user_agent""$http_x_forwarded_for"';access_loglogs/access.logmain;sendfileon;#tcp_nopushon;#keepalive_timeout0;keepalive_timeout65;#设定请求缓冲client_header_buffer_size1k;large_client_hea
3、der_buffers44k;#开启gzip模块gzipon;gzip_min_length1100;gzip_buffers48k;gzip_typestext/plain;output_buffers132k;postpone_output1460;upstreamwww.domain1.com{server192.168.30.228:8001;}upstreamwww.domain2.com{server192.168.30.221:8222;}upstreamwww.domain3.com{server192.168.30.228:8003;}server{l
4、isten80;server_namewww.domain3.com;#charsetkoi8-r;access_loglogs/host.access.logmain;location/{#roothtml;#indexindex.htmlindex.htm;proxy_passhttp://www.domain3.com;includeproxy.conf;}}server{listen80;server_namewww.domain2.com;#charsetkoi8-r;access_loglogs/host.access.logmain;location/{#
5、roothtml;#indexindex.htmlindex.htm;proxy_passhttp://www.domain2.com;includeproxy.conf;}}server{listen80;server_namewww.domain1.com;#charsetkoi8-r;access_loglogs/host.access.logmain;location/{#roothtml;#indexindex.htmlindex.htm;proxy_passhttp://www.domain1.com;includeproxy.conf;}#location
6、/NginxStatus{#stub_statuson;#access_logon;#auth_basic"NginxStatus";#auth_basic_user_fileconf/htpasswd;#}#error_page404/404.html;#redirectservererrorpagestothestaticpage/50x.html#error_page500502503504/50x.html;location=/50x.html{roothtml;}#proxythePHPscriptstoApachelisteningon127.0.0.1:8
7、0##location~.php${#proxy_passhttp://127.0.0.1;#}#passthePHPscriptstoFastCGIserverlisteningon127.0.0.1:9000##location~.php${#roothtml;#fastcgi_pass127.0.0.1:9000;#fastcgi_indexindex.php;#fastcgi_paramSCRIPT_FILENAME/scripts$fastcgi_script_name;#includefastcgi_params;#}#d
此文档下载收益归作者所有