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;    
}
相关推荐
Swift社区12 小时前
H5 与 ArkTS 通信的完整设计模型
uni-app·harmonyos
小溪彼岸15 小时前
uni-app小白从0开发一款鸿蒙Next应用到上线
uni-app·harmonyos
一颗小青松16 小时前
uniapp app端使用uniCloud的unipush
uni-app
cngm11020 小时前
uniapp+springboot后端跨域以及webview中cookie调试
spring boot·后端·uni-app
iOS阿玮2 天前
“死了么”App荣登付费榜第一名!
uni-app·app·apple
wendycwb2 天前
uni-app 在真机中canvas绘制的元素悬浮,内容不随父组件滚动问题
uni-app
frontend_frank2 天前
脱离 Electron autoUpdater:uni-app跨端更新:Windows+Android统一实现方案
android·前端·javascript·electron·uni-app
三天不学习2 天前
UniApp三端实时通信实战:SignalR在H5、APP、小程序的差异与实现
微信小程序·uni-app·signalr
念你那丝微笑2 天前
uView Plus + Vue3 + TypeScript + UniApp 正确引入 UnoCSS(避坑版)
vue.js·typescript·uni-app
念你那丝微笑2 天前
vue3+ts在uniapp项目中实现自动导入 ref 和 reactive
vue.js·typescript·uni-app