码迷,mamicode.com
首页 > 其他好文 > 详细

nginx-配置记录

时间:2018-10-12 01:34:45      阅读:41      评论:0      收藏:0      [点我收藏+]

标签:记录   log   time   cat   cgi   pass   fast   real   for   

 

 贴一个用过的nginx的配置,不包含https的配置

 

   upstream front{
        server 127.0.0.1:8080 weight=10;
    }
    upstream admin{
        server 127.0.0.1:8090 weight=5;
    }
    upstream admin2{
        server 127.0.0.1:8091 weight=5;
    }
    upstream front2{
        server 127.0.0.1:8100 weight=5;
    }
    upstream front3{
        server 127.0.0.1:8110 weight=5;
    }
    server {
        listen 80;
        underscores_in_headers on;
        server_name 域名;
        rewrite ^(.*)/front/(.*) http://域名/front2/$2 redirect;
        index index.jsp index.htm index.php;
        client_max_body_size    1000m;
        fastcgi_connect_timeout 75;
        fastcgi_read_timeout 600;
        fastcgi_send_timeout 600;
        keepalive_timeout  600;
        proxy_connect_timeout 600;
        proxy_read_timeout 600;
        location /front/ {
            proxy_redirect off;
            proxy_set_header Host $host:$server_port;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_pass http://front2;
        }
        location /admin/ {
            proxy_redirect off;
            proxy_set_header Host $host:$server_port;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_pass http://admin;
        }
        location /admin2/ {
            proxy_redirect off;
            proxy_set_header Host $host:$server_port;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_pass http://admin2;
        }
        location /front2/ {
            proxy_redirect off;
            proxy_set_header Host $host:$server_port;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_pass http://front2;
        }
        location /front3/ {
            proxy_redirect off;
            proxy_set_header Host $host:$server_port;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_pass http://front;
        }
        location ^~ /front/upload/{
            alias /data/upload/;
            access_log off;
            expires 5d;
        }
        location ^~ /admin/upload/{
            alias /data/upload/;
            access_log off;
            expires 5d;
        }
        location ^~ /front2/upload/{
            alias /data/upload/;
            access_log off;
            expires 5d;
        }
        location ^~ /front3/upload/{
            alias /data/upload/;
            access_log off;
            expires 5d;
        }
        location ^~ /MP_verify_29oSzr2bnZTqaOmk.txt{
            alias /data/upload/MP_verify_29oSzr2bnZTqaOmk.txt;
            access_log off;
            expires 5d;
        }
    }

 

nginx-配置记录

标签:记录   log   time   cat   cgi   pass   fast   real   for   

原文地址:https://www.cnblogs.com/suntray/p/9775773.html

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