uniapp h5 部署

uniapp 配置

在这里插入图片描述

服务器文件路径

打包文件结构
在这里插入图片描述

//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;    
}

相关推荐

  1. docker部署mysql5

    2024-03-14 12:26:08       39 阅读
  2. uniapp 引入h5页面

    2024-03-14 12:26:08       42 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-14 12:26:08       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-14 12:26:08       106 阅读
  3. 在Django里面运行非项目文件

    2024-03-14 12:26:08       87 阅读
  4. Python语言-面向对象

    2024-03-14 12:26:08       96 阅读

热门阅读

  1. 【Scala】一、Scala 语法基础

    2024-03-14 12:26:08       44 阅读
  2. JVM是如何解决跨代引用的?

    2024-03-14 12:26:08       34 阅读
  3. 【etcd】的限流设计

    2024-03-14 12:26:08       42 阅读
  4. 计算机视觉(CV)技术的优势和挑战

    2024-03-14 12:26:08       37 阅读
  5. vue3路由跳转时,页面如何滚动到顶部

    2024-03-14 12:26:08       42 阅读
  6. cv2.cvtColor()将二维转化为彩色图像

    2024-03-14 12:26:08       43 阅读
  7. 前端面试题 ===> 【Ajax、请求】

    2024-03-14 12:26:08       40 阅读
  8. 防抖与节流

    2024-03-14 12:26:08       39 阅读