#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


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

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

	proxy_set_header Host       $host;

    #gzip  on;

	upstream parcels-web{
    	server 127.0.0.1:8022 weight=5 max_fails=2 fail_timeout=600s;
    }

	upstream export-data{
    	server 127.0.0.1:8032 weight=5 max_fails=2 fail_timeout=600s;
    }

	upstream label-ex{
    	server 127.0.0.1:8028 weight=5 max_fails=2 fail_timeout=600s;
    }

    upstream nuxt-home{
    	server 127.0.0.1:4006 weight=5 max_fails=2 fail_timeout=600s;
    }

	server {
        listen       80;
		server_name  ~^author\.(.+)?\.(com|com.cn|tech|cn)$;

		# /export 共用 author的域名
        location /export {
            proxy_pass http://export-data;
        }

        location / {
            proxy_pass http://parcels-web;
        }

		location =/{
          rewrite / /index.html break;
          root /eship/code/vue-author-center/dist;
        }
    }

	server {
        listen       80;
        server_name  ~^label-ex\.(.+)?\.(com|com.cn|tech|cn)$;

        location / {
            proxy_pass http://label-ex;
        }
    }

	server {
        listen       80;
        server_name  ~^finance\.(.+)?\.(com|com.cn|tech|cn)$;

		proxy_read_timeout 600s;
		proxy_send_timeout 120s;

        location / {
            proxy_pass http://parcels-web;
        }

		location =/{
          rewrite / /index.html break;
          root /eship/code/vue-finance-center/dist;
        }
    }

	server {
        listen       80;
        server_name  ~^operation\.(.+)?\.(com|com.cn|tech|cn)$;

        location / {
            proxy_pass http://parcels-web;
        }

		location =/{
          rewrite / /index.html break;
          root /eship/code/vue-operation-center/dist;
        }

    }

    server {
        listen       80;
        server_name  ~^sales\.(.+)?\.(com|com.cn|tech|cn)$;

        location / {
            proxy_pass http://parcels-web;
        }


		location =/{
          rewrite / /index.html break;
          root /eship/code/vue-service-sales-center/dist;
        }

    }

	server {
        listen       80;
        server_name  ~^product\.(.+)?\.(com|com.cn|tech|cn)$;

        location / {
            proxy_pass http://parcels-web;
        }

		location =/{
          rewrite / /index.html break;
          root /eship/code/vue-product-center/dist;
        }

    }

	server {
        listen       80;
        server_name  ~^customer\.(.+)?\.(com|com.cn|tech|cn)$;

        location / {
            proxy_pass http://parcels-web;
        }

		location =/{
          rewrite / /index.html break;
          root /eship/code/vue-customer-center/dist;
        }

    }

	server {
        listen       80;
		server_name  ~^warning\.(.+)?\.(com|com.cn|tech|cn)$;

        location / {
            root /home/eship/code/vue-warning-center/dist;
            index index.html;
        }

        location /auth {
            proxy_pass http://parcels-web;
        }

		location =/{
          rewrite / /index.html break;
          root /home/eship/code/vue-warning-center/dist;
        }
    }

	server {
        listen       80;
        server_name  ~^api\.(.+)?\.(com|com.cn|tech|cn)$;

        location / {
            proxy_pass http://parcels-web;
        }
    }

    ## nuxt-home
    server {
        listen       8080;
        server_name ~^home\.(eship|17feia|weaship|parcels|51kj56)\.(com|com\.cn)$;


		location / {
			 proxy_pass http://nuxt-home;
		}
    }

	# 静态文件服务器
    server {
        listen       80;
        server_name ~^static\.(.+)?\.(com|com.cn|tech|cn)$;

        location / {
            root /home/nfs;
        }
    }

}
12-18 04:33