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;    
}
相关推荐
&白帝&2 小时前
uniapp中使用picker-view选择时间
前端·uni-app
fakaifa2 小时前
八戒农场小程序V2最新源码
小程序·uni-app·php·生活·开源软件
平凡シンプル6 小时前
安卓 uniapp跨端开发
android·uni-app
艾小逗8 小时前
uniapp快速入门教程,内容来源于官方文档,仅仅记录快速入门需要了解到的知识点
小程序·uni-app·app·es6
鸭子嘎鹅子呱1 天前
uniapp使用高德地图设置marker标记点,后续根据接口数据改变某个marker标记点,动态更新
uni-app·map·高德地图
计算机源码社1 天前
分享一个基于微信小程序的居家养老服务小程序 养老服务预约安卓app uniapp(源码、调试、LW、开题、PPT)
android·微信小程序·uni-app·毕业设计项目·毕业设计源码·计算机课程设计·计算机毕业设计开题
Angus-zoe1 天前
uniapp+vue+微信小程序实现侧边导航
vue.js·微信小程序·uni-app
Pluto & Ethereal1 天前
uni-app尺寸单位、flex布局于背景图片
uni-app
天空下sky2 天前
uniapp+若依 开发租房小程序源码分享
uni-app
帅过二硕ฅ2 天前
uniapp点击跳转到对应位置
前端·javascript·uni-app