2020-09-11_NGINX配置反向代理_笔记


worker_processes  1;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        off;
    keepalive_timeout  65;

   # gzip  on;
   # gzip_min_length 512;
   # gzip_buffers 4 16k;
    #gzip_comp_level 7;
    #gzip_types text/plain application/x-javascript text/css application/xml text/javascript image/jpeg image/jpg image/gif image/png;
    #gzip_vary off;
    #gzip_disable "MSIE [1-6]\.";

    server {
            listen       8200;
            client_max_body_size 20m;        
            #=====================智慧商城用户端===========
            #智慧商城用户端
            location /custom-api/{
                    proxy_pass http://127.0.0.1:7001/custom/;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header REMOTE-HOST $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            }
            #========================end===================

             #=====================智慧商城后管端===========
            #智慧商城后管端
            location /manage-api/{
                    proxy_pass http://127.0.0.1:7001/manage/;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header REMOTE-HOST $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            }       
            #========================end===================
            
            #=====================智慧商城商户微信后管端===========
            #智慧商城后管端
            location /business-api/{
                    proxy_pass http://127.0.0.1:7001/business/;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header REMOTE-HOST $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            }       
            #========================end===================
            
            #静态资源存放-用户
            location /zhsqsc-custom/ {
                root   /opt/static/;
                autoindex on;
                try_files $uri $uri/ /zhsqsc-custom/index.html?$args;
            }
            
            #静态资源存放-后管
            location /zhsqsc-manage/ {
                root   /opt/static/;
                autoindex on;
                try_files $uri $uri/ /zhsqsc-manage/index.html?$args;
            }

            #静态资源存放-商户
            location /zhsqsc-business/ {
                    root   /opt/static/;
                    autoindex on;
                    try_files $uri $uri/ /zhsqsc-business/index.html?$args;
            }

            #静态资源存放-test
            location /test/ {
                    root   /opt/static/;
                    autoindex on;
            }

            #资源库地址
            location /file/ {
                    root   /opt/;
                    autoindex on;
            }
    }
}
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值