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;    
}
相关推荐
moxiaoran575331 分钟前
uni-app项目实战笔记5--使用grid进行定位布局
笔记·uni-app
每天都想着怎么摸鱼的前端菜鸟3 小时前
【uniapp】uniapp热更新WGT资源,简单的多环境WGT打包脚本
javascript·uni-app
「、皓子~17 小时前
AI创作系列(2):UniApp跨端开发实战 - 海狸IM移动端完全由AI编写
开发语言·人工智能·uni-app·开源·vue·开源软件·ai编程
每天都想着怎么摸鱼的前端菜鸟20 小时前
【uniapp】uni.chooseImage在Android 13以下机型第一次调用授权后无权限问题
javascript·uni-app
满分观测网友z1 天前
uni-app 滚动视图scroll-view从入门到精通
uni-app
小妖6661 天前
uni-app bitmap.load() 返回 code=-100
前端·javascript·uni-app
走,带你去玩1 天前
uniapp 时钟
javascript·css·uni-app
耶啵奶膘1 天前
uniapp——input 禁止输入 ,但是可以点击(禁用、可点击)
uni-app
前端与小赵1 天前
uni-app隐藏返回按钮
前端·uni-app
胡斌附体1 天前
uniapp小程序不支持动态组件问题
小程序·uni-app·if-else·动态组件·不支持·编译异常