From 246f0caaa54bea56927852cf4de6fb8733c5fd9d Mon Sep 17 00:00:00 2001 From: WangChenChen <9325600435@qq.com> Date: Sun, 21 Apr 2024 11:05:20 +0800 Subject: [PATCH] =?UTF-8?q?1.nginx.conf=E6=B7=BB=E5=8A=A0=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 2 +- nginx.conf | 46 +++++++++------------------------ platform-web-ui/.env.production | 2 +- redis.conf | 22 ---------------- 4 files changed, 14 insertions(+), 58 deletions(-) delete mode 100644 redis.conf diff --git a/docker-compose.yml b/docker-compose.yml index d7c4f8a..27dc85c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -58,7 +58,7 @@ services: - /data/redis7/data:/data - /data/redis7/conf/redis.conf:/etc/redis/redis.conf - /etc/localtime:/etc/localtime:ro - command: [ "redis-server","/etc/redis/redis.conf" ] + command: redis-server --requirepass redis123456 --appendonly yes privileged: true restart: always networks: diff --git a/nginx.conf b/nginx.conf index 83c7de8..1a209fc 100644 --- a/nginx.conf +++ b/nginx.conf @@ -37,14 +37,17 @@ http { add_header X-Xss-Protection 1; server { - listen 80; - server_name molly.example.com; - location / { - root /html/platform; - index index.html; - } - - location /api/ { + listen 80; + server_name localhost; + location / { + root /html/tenant; + index index.html; + } + location /platform { + alias /html/platform; + index index.html; + } + location /api { rewrite ^/api/(.*)$ /$1 break; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; @@ -54,32 +57,7 @@ http { proxy_set_header Connection "upgrade"; # docker 环境下使用 proxy_pass http://molly:18891/; proxy_pass http://127.0.0.1:18891/; - } - - } - - - server { - listen 80; - ## 通配符域名。如: hello.molly.example.com 、 test.molly.example.com - server_name *.molly.example.com; - location / { - root /html/tenant; - index index.html; } - - location /api/ { - rewrite ^/api/(.*)$ /$1 break; - proxy_set_header Host $http_host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header REMOTE-HOST $remote_addr; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # docker 环境下使用 proxy_pass http://molly:18891/; - proxy_pass http://127.0.0.1:18891/; - } - - } + } } diff --git a/platform-web-ui/.env.production b/platform-web-ui/.env.production index d0fa13a..9b9782e 100644 --- a/platform-web-ui/.env.production +++ b/platform-web-ui/.env.production @@ -7,4 +7,4 @@ VITE_BASE_API = '/api' VITE_ROUTER_HISTORY = 'hash' ## 打包路径(就是网站前缀,例如部署到 https://un-pany.github.io/v3-admin-vite/ 域名下,就需要填写 /v3-admin-vite/) -VITE_PUBLIC_PATH = '/' +VITE_PUBLIC_PATH = '/platform/' diff --git a/redis.conf b/redis.conf deleted file mode 100644 index eee3dc6..0000000 --- a/redis.conf +++ /dev/null @@ -1,22 +0,0 @@ -#开启远程可连接 -bind 0.0.0.0 -#自定义密码 -#requirepass mht123456 -#指定 Redis 监听端口(默认:6379) -port 6379 -#客户端闲置指定时长后关闭连接(单位:秒。0:关闭该功能) -timeout 0 -# 900s内如果至少一次写操作则执行bgsave进行RDB持久化操作 -save 900 1 -# 在300s内,如果至少有10个key进行了修改,则进行持久化操作 -save 300 10 -#在60s内,如果至少有10000个key进行了修改,则进行持久化操作 -save 60 10000 -#是否压缩数据存储(默认:yes。Redis采用LZ 压缩,如果为了节省 CPU 时间,可以关闭该选项,但会导致数据库文件变的巨大) -rdbcompression yes -#指定本地数据文件名(默认:dump.rdb) -dbfilename dump.rdb -#指定本地数据文件存放目录 -dir /data -#指定日志文件位置(如果是相对路径,redis会将日志存放到指定的dir目录下) -logfile /data/redis.log \ No newline at end of file