uniapp h5 部署

uniapp 配置

服务器文件路径

打包文件结构

bash 复制代码
//nginx 配置
server {
    listen       8300;
    server_name  bfqcwebsiteapp;
    charset utf-8;

         #允许跨域请求的域,* 代表所有
      add_header 'Access-Control-Allow-Origin' *;
      #允许带上cookie请求
      add_header 'Access-Control-Allow-Credentials' 'true';
      #允许请求的方法,比如 GET/POST/PUT/DELETE
      add_header 'Access-Control-Allow-Methods' *;
      #允许请求的header
      add_header 'Access-Control-Allow-Headers' *;

    location ^~ /admin {
           root   /www/projects/bfqcwebsiteapp;
			try_files $uri $uri/ /index.html;
            index  index.html index.htm;
        }

    location ^~ /mobile {
        root   /www/projects/bfqcwebsiteapp;
        try_files $uri $uri/ /index.html;
        index  index.html index.htm;
        # autoindex on;
    }
		
	location /prod-api/ {
		proxy_set_header Host $http_host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header REMOTE-HOST $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_pass http://localhost:8229/;
	}
		
	location /statics/profile/ {
        rewrite /statics/profile/(.*) /statics/$1 last;
    }
   
    location /profile/ {
        alias  /www/projects/bfqcwebsiteapp/uploadPath/;
    }
		
    # 避免actuator暴露
    if ($request_uri ~ "/actuator") {
        return 403;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
    access_log  /www/wwwlogs/access.log;    
}
相关推荐
bug总结17 小时前
uniapp的easycom自动组件注册机制
uni-app
HF_code18 小时前
uniapp-history路由深度指南
uni-app
suliqiang20 小时前
【前端技术】 Web 前端技术36年 演进全景图
信息可视化·微信小程序·小程序·前端框架·uni-app·人机交互·xcode
梦曦i2 天前
uni-router v0.2.0重磅发布:全链路拦截+重复导航优化
前端·uni-app
EatFan2 天前
【实战经验】uni-app使用 SSE 踩坑,EventSource不支持怎么办?
android·后端·ios·uni-app
凡泰AI2 天前
如何为政务 APP 搭建开放平台,实现多部门、第三方供应商标准化入驻与统一管理
android·大数据·小程序·uni-app·app·政务
梦曦i2 天前
@meng-xi/uni-router 未来展望:夯实基础、深化体验、探索前沿
前端·uni-app
2501_916007473 天前
使用Apple Dashboards显示和自定iOS应用性能指标与数据可视化指南
android·ios·小程序·https·uni-app·iphone·webview
爱折腾的编程老炮3 天前
潮玩小程序订单模型-一张表装下所有玩法
spring boot·小程序·uni-app
两个人的幸福online3 天前
UniApp 对接 IM 即时通讯全攻略(下篇)
uni-app