union.yoho.cn.conf.j2 1.63 KB
server{
    listen       80;
    server_name  union.yoho.cn webunion.yohobuy.com union.yoho.yohoops.org;
    access_log /Data/logs/nginx/access_union.log  union;
    error_log  /Data/logs/nginx/union_error.log;

    location ^~ /admin {
    {% for item in yoho_office_ips %}
    allow {{ item }};
    {%  endfor %}
    deny all;
         proxy_redirect off;
         proxy_pass  http://union_pools/union/admin;
         proxy_set_header   Host   $host;
         proxy_set_header   X-Real-IP  $http_x_forwarded_for;
         proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header   Accept-Encoding "gzip";
     }

     location ^~ /union/admin {
     {% for item in yoho_office_ips %}
     allow {{ item }};
     {%  endfor %}
     deny all;
	     proxy_redirect off;
         proxy_pass  http://union_pools/union/admin;
         proxy_set_header   Host   $host;
         proxy_set_header   X-Real-IP  $http_x_forwarded_for;
         proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header   Accept-Encoding "gzip";
     }


    
    # for ios Universal Links
      location  /.well-known/apple-app-site-association {
        root  /Data/local/openresty-1.9.15.1/nginx/html/;
      }


    location / {
        proxy_redirect off;
        proxy_pass  http://union_pools;
        proxy_set_header   Host   $host;
        proxy_set_header   X-Real-IP  $http_x_forwarded_for;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   Accept-Encoding "gzip";
    }
     
location  ~* .(txt)$ {
        root /Data/local/openresty-1.9.15.1/nginx/html;
    }

}