zoukankan      html  css  js  c++  java
  • nginx 配置文件(windows)

    1. nginx.conf
      #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  1024;
      }
      http {
          include       mime.types;
          default_type  application/octet-stream;
      
          sendfile        on;
          #tcp_nopush     on;
      
          #keepalive_timeout  0;
          keepalive_timeout  420;
      
          #gzip  on;  
          upstream base{
              server **.**.**.**:8002;
          # server 10.0.84.118:87;
          }
          upstream instock{
            #  server **.**.**.**:8003;
               server 10.0.84.118:83;
          }
          upstream stock{
              server **.**.**.**:8004;
          }
          upstream outstock{
              server **.**.**.**:8005;
          }
          
          upstream zlwms {
              server 10.0.84.118:83; //pc端的ip和服务端口
          }
      
          server {
              listen 80;
              
              server_name zlwms.local;
              if (-d $request_filename){
                      rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;
              }
      
              location ~ ^/(WEB-INF)/ {
                       deny all;
              }
      
              
              location /base/ {
                  root /opt/www/base-web/defalut;
                  charset utf-8;
                  index index.jsp index.action;
                  proxy_pass http://base;
                  
                  proxy_redirect off;
                  proxy_set_header Host $host;
                  proxy_set_header X-Real-IP $remote_addr;
                  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                  client_max_body_size 10m;
                  client_body_buffer_size 128k;
                  proxy_connect_timeout 90;
                  proxy_send_timeout 90;
                  proxy_read_timeout 90;
                  proxy_buffers 32 4k;
                  #include /opt/conf/nginx/proxy-resin.conf;
              }
              
              
              location /stock/ {
                  root /opt/www/stock-web/defalut;
                  charset utf-8;
                  index index.jsp index.action;            
                  proxy_pass http://stock;
                  
                  proxy_redirect off;
                  proxy_set_header Host $host;
                  proxy_set_header X-Real-IP $remote_addr;
                  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                  client_max_body_size 10m;
                  client_body_buffer_size 128k;
                  proxy_connect_timeout 90;
                  proxy_send_timeout 90;
                  proxy_read_timeout 90;
                  proxy_buffers 32 4k;
                  # include /opt/conf/nginx/proxy-resin.conf;
              }
              
          
              location /instock/ {
                  root /opt/www/instock-web/defalut;
                  charset utf-8;
                  index index.jsp index.action;            
                  proxy_pass http://instock;
                  
                  proxy_redirect off;
                  proxy_set_header Host $host;
                  proxy_set_header X-Real-IP $remote_addr;
                  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                  client_max_body_size 10m;
                  client_body_buffer_size 128k;
                  proxy_connect_timeout 90;
                  proxy_send_timeout 90;
                  proxy_read_timeout 90;
                  proxy_buffers 32 4k;
                  # include /opt/conf/nginx/proxy-resin.conf; 
              }
                      
              location /outstock/ {
                  root /opt/www/outstock-web/defalut;
                  charset utf-8;
                  index index.jsp index.action;            
                  proxy_pass http://outstock;
                  
                  proxy_redirect off;
                  proxy_set_header Host $host;
                  proxy_set_header X-Real-IP $remote_addr;
                  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                  client_max_body_size 10m;
                  client_body_buffer_size 128k;
                  proxy_connect_timeout 90;
                  proxy_send_timeout 90;
                  proxy_read_timeout 90;
                  proxy_buffers 32 4k;
                  # include /opt/conf/nginx/proxy-resin.conf; 
              }
              
              location / {
                 root /opt/www/outstock-web/defalut;
                  charset utf-8;
                  index index.jsp index.action;            
                  proxy_pass http://instock;
                  
                  proxy_redirect off;
                  proxy_set_header Host $host;
                  proxy_set_header X-Real-IP $remote_addr;
                  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                  client_max_body_size 10m;
                  client_body_buffer_size 128k;
                  proxy_connect_timeout 90;
                  proxy_send_timeout 90;
                  proxy_read_timeout 90;
                  proxy_buffers 32 4k;
                  # include /opt/conf/nginx/proxy-resin.conf;  
              }
          }
      }
  • 相关阅读:
    python练习:抓取统计log内ip数量
    再来说一说sudo
    Nginx 1 Web Server Implementation Cookbook系列--(1)debug mode
    MySQL 5.7 关闭严格模式
    beanstalkd 消息队列
    国内git项目托管平台
    Git忽略.gitignore规则不生效的解决办法
    Ubuntu 上搭建 Samba 服务器
    Memcached+PHP+Mysql+Linux 实践
    php use memcached in ubuntu 14.04
  • 原文地址:https://www.cnblogs.com/wangzhanhua/p/10362288.html
Copyright © 2011-2022 走看看