nginx常用配置

server {
    listen       80;
    server_name  sbox-promote.xxxx.com sbox-isp.xxxx.com sbox-dsp.xxxx.com sbox-ssp.xxxx.com sbox-a.xxxx.com openapi.xxxx.com;
    index  index.html index.htm;


        # 前段地址nginx配置  begin
        location ^~ /isp-static/ {
            charset utf-8;
          #  access_log off;
        }
        location ^~ /js/ {
            charset utf-8;
          #  access_log off;
        }
        ## 前段地址nginx配置  End






        ## tomcat服务配置 Begin
        location ^~ /isp-kongming/ {
            #access_by_lua_file "/usr/local/openresty/lualib/waf.lua";
            proxy_read_timeout      3600;
            proxy_connect_timeout   3000;
            proxy_http_version 1.1;
            proxy_set_header Host $http_host;
            proxy_pass http://isp.kongming;
            proxy_redirect off;
            access_log on;
        }
        ## isp End


## 图片服务配置 Begin
        location ^~ /img/ {
            proxy_pass http://sbox-ssp.xxxx.com/img/;
        }


## OSS Begin
location ^~ /oss-manager/ {
            proxy_read_timeout      3600;
            proxy_connect_timeout   3000;
            proxy_redirect          off;
            proxy_http_version 1.1;
            client_max_body_size 1024m;
            proxy_set_header Host $http_host;
            proxy_pass http://oss.manager;
            access_log on;
    }
## OSS End


        ## SSP服务 Begin
        location ^~ /perm-manager/ {
            #access_by_lua_file "/usr/local/openresty/lualib/waf.lua";
            proxy_read_timeout      3600;
            proxy_connect_timeout   3000;
            proxy_http_version 1.1;
            proxy_set_header Host $http_host;
            proxy_pass http://perm.manager;
            proxy_redirect off;
            access_log on;
        }
      




      ##配置不同组域名对应路径
        location / {
            access_log on;
    content_by_lua '
                if ngx.var.host == "sbox-dsp.xxxx.com" then
                    ngx.redirect("/dsp-static/")
                elseif ngx.var.host == "sbox-isp.xxxx.com" then
                    ngx.redirect("/isp-static/")
                elseif ngx.var.host == "sbox-ssp.xxxx.com" then
                    ngx.redirect("/ssp-static/")
                elseif ngx.var.host == "sbox-promote.xxxx.com" then
                    ngx.redirect("/promote_dist/")
                end
            ';
        }


        access_log  /data/wwwlogs/access_psc.xxxx.com.log  access;
 }
  
  upstream isp.kongming {
      server 192.168.87.77:8081;
  }
  
  upstream a_xxxx_com {
      server 192.168.87.79:8880;
  }  


  upstream isp.process {
      server 192.168.87.77:8082;
  }
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值