worker_processes  1;
env TZ;
events {
    worker_connections  1024;
}

http {
	resolver 8.8.8.8 8.8.4.4 valid=30s ipv6=off;
    resolver_timeout 5s;
    include       mime.types;
    default_type  application/octet-stream;
    client_max_body_size 100M;

    sendfile        on;
   
    keepalive_timeout  65;
	
	
	server {
        listen       443 ssl; # 监听端口
        server_name  api.embeb.com;
        # 证书文件
        ssl_certificate      /usr/local/nginx/conf/cert/api.embeb.com.pem;
        ssl_certificate_key  /usr/local/nginx/conf/cert/api.embeb.com.key;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;

        location / {
                proxy_pass http://127.0.0.1:8888;
        }
	}
	
	server {
        listen       443 ssl; # 监听端口
        server_name  static.embeb.com;
        # 证书文件
        ssl_certificate      /usr/local/nginx/conf/cert/static.embeb.com.pem;
        ssl_certificate_key  /usr/local/nginx/conf/cert/static.embeb.com.key;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;

        location / {
            root  /usr/local;
			autoindex on;
        }
	}

	server {
        listen       443 ssl; # 监听端口
        server_name  www.embeb.com;
        # 证书文件
        ssl_certificate      /usr/local/nginx/conf/cert/www.embeb.com.pem;
        ssl_certificate_key  /usr/local/nginx/conf/cert/www.embeb.com.key;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;

		location / {
                add_header Content-Security-Policy upgrade-insecure-requests;
                root   /usr/local/wugufu/app;
                try_files $uri $uri/  /index.html;
                index  index.html index.htm;
        }
	}



        server {
        listen       80;
        server_name  crm.embeb.com;

        location / {
            proxy_pass http://127.0.0.1:8888;
        }
    }
server {
        listen       443 ssl; # 监听端口
        server_name  crm.embeb.com;
        # 证书文件
        ssl_certificate      /usr/local/nginx/conf/cert/crm.embeb.com.pem;
        ssl_certificate_key  /usr/local/nginx/conf/cert/crm.embeb.com.key;
        ssl_protocols TLSv1.2 TLSv1.3;
        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;
        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;
        location / {
	       proxy_ssl_server_name on;
	       proxy_ssl_session_reuse off;
	       client_max_body_size 500M;
           resolver 8.8.8.8 ipv6=off;
           proxy_pass http://127.0.0.1:8888;
        }



    }

server {
        listen       80;
        server_name  static.embeb.com;

        location / {
            root  /usr/local;
			autoindex on;
        }
    }

server {
          listen       80;
        server_name  www.embeb.com;

        location / {
            proxy_pass https://www.embeb.com;
        }
    }
	
	server {
          listen       80;
        server_name  embeb.com;

        location / {
            proxy_pass https://www.embeb.com;
        }
    }

}

