server {
      listen 80 default;
      server_name nginx-service
      server_tokens off;     # don't show the version number, a security best practice
      client_max_body_size 20m;
      access_log  /data/log/backend/www_access.log;
      error_log   /data/log/backend/www_error.log;
     error_page 404 /404.html;
     set $gmapp_name backend;
     real_ip_header  X-Forwarded-For;
     proxy_set_header X-Forwarded-For $http_remoteip;
      root /srv/apps/phantom/phantom-release;
      location /phantom/ {
        try_files $uri $uri /index.html;
      }
      location /phantomStatic/ {
        alias /srv/apps/phantom/phantom-release/phantomStatic/;
      }
      location = / {
        return 301 http://www.igengmei.com/;
      }
     location / {
        try_files $uri $uri/ =404;
     }
     location /lipstick/ {
            alias  /srv/apps/backend/lipstick/;
     }
     location /pretty {
          return 301 http://www.igengmei.com;
     }

     location /event/download {
          return 301 http://www.igengmei.com;
      }
     location /tuangou {
        return 301 /api/order/validate/;
     }
     location /favicon.ico {
        return 301 /static/favicon.ico;
     }
     location ~ ^/static/(.*)$ {
        alias  /srv/apps/backend/hybrid/fe-dist/static/$1;
        expires 864000;
     }
     location /hybrid {
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $http_host;
                proxy_set_header X-Forwarded-Host $server_name;
                proxy_set_header X-GM-Request-Id $request_id;
                proxy_redirect off;
                proxy_pass http://backend-service;
     }
     location /api {
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $http_host;
                proxy_set_header X-Forwarded-Host $server_name;
                proxy_set_header X-GM-Request-Id $request_id;
                proxy_redirect off;
                proxy_pass http://backend-service;
            }
      location /api/live/danmu {
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $http_host;
                proxy_set_header X-Forwarded-Host $server_name;
                proxy_redirect off;
                proxy_pass http://danmu-service;
            }
      location /api/face/query_result {
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $http_host;
                proxy_set_header X-Forwarded-Host $server_name;
                proxy_redirect off;
                proxy_pass http://danmu-service;
            }
        location /pay {
                proxy_set_header X-Forwarded-For $http_remoteip;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-GM-Request-Id $request_id;
                proxy_set_header Host $http_host;
                proxy_redirect off;
                proxy_pass http://backend-service;
            }
            location /analytics/page/ {
                return 404;
            }
            location /stat {
                proxy_set_header X-Forwarded-For $http_remoteip;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $http_host;
                proxy_redirect off;
                proxy_pass http://backend-service;
            }
            location /join {
                proxy_set_header X-Forwarded-For $http_remoteip;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $http_host;
                proxy_redirect off;
                proxy_pass http://backend-service;
            }
            location /contacts {
                proxy_set_header X-Forwarded-For $http_remoteip;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $http_host;
                proxy_redirect off;
                proxy_pass http://backend-service;
            }
            location /files {
                proxy_set_header X-Forwarded-For $http_remoteip;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $http_host;
                proxy_redirect off;
                proxy_pass http://backend-service;
            }
            location /accounts {
                proxy_set_header X-Forwarded-For $http_remoteip;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-GM-Request-Id $request_id;
                proxy_set_header Host $http_host;
                proxy_redirect off;
                proxy_pass http://backend-service;
            }
            location /xcx {
                proxy_set_header X-Forwarded-For $http_remoteip;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-GM-Request-Id $request_id;
                proxy_set_header Host $http_host;
                proxy_redirect off;
                proxy_pass http://backend-service;
            }
     #       location ~ ^/zhengxing/static/(.*)$ {
     #           alias  /srv/static/backend/static/$1;
     #           expires 864000;
     #       }
     #   location ~ ^/zhengxing/media/apk/(.*)$ {
     #       alias  /srv/media/backend/media/apk/$1;
     #   }
     #       location ~ ^/zhengxing/media/([^-]*)(-.*)?$ {
     #           alias  /srv/media/backend/media/$1;
     #           expires 864000;
     #       }
     #       location ~ ^/static/(.*)$ {
     #           alias  /srv/static/backend/static/$1;
     #           expires 864000;
     #       }
     #   location ~ ^/media/apk/(.*)$ {
     #           alias  /srv/media/backend/media/apk/$1;
     #       }
     #       location ~ ^/media/(.*)$ {
     #           alias  /srv/media/backend/media/$1;
     #           expires 864000;
     #       }
            location /wuhongfei {
                return 301 /event/download/wuhongfei/;
            }
            location /nvqingshou{
                return 301 /event/download/nvqingshou/;
            }
            location /guanbo{
                return 301 /event/download/guanbo/;
            }
            location /weibo{
                return 301 /event/download/weibo/;
            }
            location /mrlittlebush{
                return 301 /event/download/mrlittlebush/;
            }
            location /event/bjdy{
                return 301 /event/download/bjdy/;
            }
            location /event/bjwd{
                return 301 /event/download/bjwd/;
            }
            location /event/love163{
                return 301 /event/download/love163/;
            }
            location /event/cd{
                return 301 /event/download/cd/;
            }
            location /event/guoyinxufan{
                return 301 /event/download/guoyinxufan/;
            }
            location /event/tengxunweibo{
                return 301 /event/download/tengxunweibo/;
            }
            location /event/book-zxsrj{
                return 301 /event/download/book-zxsrj/;
            }
            location /event/fx{
                return 301 /event/download/fx/;
            }
            location /event/wuhongfei {
                return 301 /event/download/wuhongfei/;
            }
            location /event/nvqingshou{
                return 301 /event/download/nvqingshou/;
            }
            location /event/guanbo{
                return 301 /event/download/guanbo/;
            }
            location /event/weibo{
                return 301 /event/download/weibo/;
            }
            location /event/mrlittlebush{
                return 301 /event/download/mrlittlebush/;
            }
            location /app{
                return 301 /event/download/mp/;
            }
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
}
