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;
            }
        }
  • 相关阅读:
    zz解读NoSQL技术代表之作Dynamo
    愚蠢且能干
    Schema 验证和 DTD 验证
    Office Addin (VSTO) Performance Tips & Tricks
    提高 .NET 应用 XML 处理性能的几点开发经验(转载)
    C# 实现对XML文件的基本操作(创建xml文件,增、删、改、查 xml节点信息)zz
    XML/XSLT/XPATH
    Linux下基于DNS的多机均衡负载的实现
    Linux 上的高可用中间件,第 3 部分: IBM LoadLeveler
    Creating Web Services using Apache
  • 原文地址:https://www.cnblogs.com/suntray/p/9775773.html
Copyright © 2011-2022 走看看