码迷,mamicode.com
首页 > Windows程序 > 详细

win上配置nginx

时间:2017-12-07 19:04:11      阅读:15      评论:0      收藏:0      [点我收藏+]

标签:pem   127.0.0.1   time   bucket   oca   eal   str   需要   header   

win上配置nginx

    网上配置nginx的教程大多都是linux上的,今天贴出来nginx在win上的配置,在此篇配置中,nginx代理了Tomcat以及node服务。配置如下:

     注意:根据实际经验来看,在win上修改完成nginx之后,需要将nginx的所有服务都关闭,然后重启,否则,只是一味的reload则服务并不会生效。

#user nobody;
worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 51200; } http { include mime.types; default_type application/octet-stream; server_names_hash_bucket_size 96; #log_format main ‘$remote_addr - $remote_user [$time_local] "$request" ‘ # ‘$status $body_bytes_sent "$http_referer" ‘ # ‘"$http_user_agent" "$http_x_forwarded_for"‘; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; gzip on;
  #node服务端口 upstream baidu.xxx.com{ server 127.0.0.1:9919; }
  #tomcat服务端口 upstream xinlang.xxx.com{ server 127.0.0.1:8080; } server { listen 80; server_name baidu.xxx.com ; #charset koi8-r; #access_log logs/host.access.log main; location / { proxy_pass http://127.0.0.1:9919; } } server { listen 80; server_name xianlang.xxx.com ; #charset koi8-r; #access_log logs/host.access.log main; location / { index index.html index.jsp; proxy_pass http://xinlang.xxx.com ; proxy_set_header X-Real-IP $remote_addr; client_max_body_size 100m; } } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443 ssl; # server_name localhost; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #} }

win上配置nginx

标签:pem   127.0.0.1   time   bucket   oca   eal   str   需要   header   

(0)
(0)
   
举报
评论 一句话评论(0
0条  
登录后才能评论!
© 2014 mamicode.com 版权所有 京ICP备13008772号-2
迷上了代码!