Nginx配置文件

worker_processes 1;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

sendfile        on;
keepalive_timeout  65;

add_header 'Access-Control-Allow-Origin' $http_origin;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';

gzip on;
gzip_min_length 1k;
gzip_buffers    4 32k;
gzip_http_version 1.1;
gzip_comp_level 6;
gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml image/jpeg image/gif image/png;
gzip_vary on;
client_max_body_size 100M;
client_header_buffer_size 512k;
large_client_header_buffers 4 512k;

proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-real-ip $remote_addr;

upstream pushServer{
    server 10.131.227.34:8085;
}

upstream support{
    server 10.131.227.34:8084;
}

upstream filepath{
    server 10.131.227.34:80;
}

upstream consult{
    server 10.131.227.7:8082;
}

upstream dongcheng{
    server 10.131.227.7:8080 max_fails=3 fail_timeout=30s;
    server 10.131.227.15:8080 max_fails=3 fail_timeout=30s;
}

upstream access{
    server 10.131.227.7:8081 max_fails=3 fail_timeout=30s;
    server 10.131.227.15:8081 max_fails=3 fail_timeout=30s;
}

map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}

upstream fire_society{
    server 10.131.227.225:9000;
}

upstream geoserver{
    server 10.131.232.103:8087;
}

server {
    listen       8020;
    server_name  localhost;
	
    location / {
        root   /app/site;
        index  index.html index.htm login;
    }
	
    location /filepath {
		proxy_pass http://filepath;
		proxy_http_version 1.1;
		proxy_connect_timeout 4;
		proxy_read_timeout 600;
		proxy_send_timeout 600;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection $connection_upgrade;
    }

    location ~/dongfile/M00 {
       ngx_fastdfs_module;
    }

    location ^~ /access/v1.0 {
        proxy_pass http://access;
    }

    location ~/dongcheng/v1.0 {
        proxy_pass http://dongcheng;
    }

    location ^~ /consult {
        proxy_pass http://consult;
        proxy_http_version 1.1;
        proxy_connect_timeout 4;
        proxy_read_timeout 600;
        proxy_send_timeout 600;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    }

    location ^~ /pushServer {
		proxy_pass http://pushServer;
		proxy_http_version 1.1;
		proxy_connect_timeout 4;
		proxy_read_timeout 600;
		proxy_send_timeout 600;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection $connection_upgrade;
    }

    location /support/v1.0 {
        # proxy_pass http://10.131.227.34:8084;
		proxy_pass http://support;
		proxy_http_version 1.1;
		proxy_connect_timeout 4;
		proxy_read_timeout 600;
		proxy_send_timeout 600;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection $connection_upgrade;
    }

    location /sjzServer {
        proxy_pass	http://127.0.0.1:8089;
    }

    location /fire_society {
        proxy_pass	http://fire_society/;
    }
	
    location /geoserver {
        proxy_pass	http://geoserver;
    }
}

}

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 创作都市 设计师:CSDN官方博客 返回首页