zoukankan      html  css  js  c++  java
  • nginx配置记录

     

     贴一个用过的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;
            }
        }
  • 相关阅读:
    setprecision和setiosflags函数
    free和malloc的使用
    栈内存与堆内存
    一个教科书一般的“空指针”错误
    孙鑫教程第三章小测试程序
    向函数传递结构体信息
    指针(二)
    指针(一)
    cocos2d场景和UIViewController视图的切换
    UIScrollView 原理详解
  • 原文地址:https://www.cnblogs.com/suntray/p/9775773.html
Copyright © 2011-2022 走看看