uniapp package release H5 nginx access

Step 1: Set manifest.json

Source view:

Step Two: Packing

 

 

 

 Copy the compiled file to the server tomcat webapps directory

 

 

nginx configuration

tomcat 8080 模块化
upstream wedding_api {
      server localhost:8080 fail_timeout=0;
}

    #强制转发至https协议的 域名配置
    server {
        listen 80;
        server_name test.cn  www.test.cn;
        add_header Strict-Transport-Security max-age=15768000;
        return 301 https://$server_name$request_uri;
     }



#####https代理,此域名监听443端口(http默认监听443),以https协议访问#####
server {
        listen 80 default backlog=2048;
        listen 443 ssl;
        server_name  test.cn  www.test.cn;
        # 下面ssl开头的是HTTPS相关的设置
        #ssl on;   #把ssl on;这行去掉,ssl写在443端口后面。这样http和https的链接都可以用
        ssl_certificate  /usr/local/nginx/conf/cert/6573978_test.cn_nginx/6573978_test.cn.pem;
        ssl_certificate_key  /usr/local/nginx/conf/cert/6573978_test.cn_nginx/6573978_test.cn.key;
        ssl_session_timeout  5m;#session有效期,根据需要适当延长
        ssl_session_cache  shared:SSL:10m;
	client_max_body_size 100M;
        # 使用的加解密方式
        ssl_ciphers  ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        # 支持的协议类型
        ssl_protocols   TLSv1 TLSv1.1 TLSv1.2;
        # 优先使用服务端的加解密方式
        ssl_prefer_server_ciphers on;
        location / {
        # 单个服务
            proxy_pass http://wedding_api;
            # 负载均衡
            # proxy_pass http://yourServers/;
	    proxy_read_timeout 150;  # 秒
            proxy_redirect off;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
            proxy_set_header  Host  $http_host;
            proxy_set_header  X-NginX-Proxy  true;
            # 启用支持websocket连接
            #proxy_set_header Upgrade $http_upgrade;
	    #proxy_set_header Connection "upgrade";
         }

 	 location /MP_verify_D5cKxzn8fPeR2wgf.txt {
 		 alias /usr/local/nginx/conf/cert/MP_verify_D5cKxzn8fPeR2wgf.txt;
	}

	# 代理静态资源
 	location /files/ {
          	   alias /project/uploadfile/wedding/;
		   try_files $uri $uri/;
		   index index.html index.htm;
        }

    }

 

 

Guess you like

Origin blog.csdn.net/wcdunf/article/details/123177852