Skip to content

Commit

Permalink
🎉 version(architecture): v0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Ting-Code committed Aug 20, 2024
1 parent 08c82a8 commit 1454d8a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ COPY ./packages/apps/micro-docs/dist/ /usr/share/nginx/html/docs/
# 复制nginx配置到容器中
COPY ./.github/workflows/nginx.conf /etc/nginx/nginx.conf
# 指定端口
EXPOSE 80
EXPOSE 80 8680
# 启动 Nginx
CMD ["nginx", "-g", "daemon off;"]
2 changes: 1 addition & 1 deletion .github/workflows/dockerBootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ docker rmi tingcode/web-admin:latest
# 拉取镜像
docker pull tingcode/web-admin:latest

docker run --rm -d -p 80:80 -p 8680:8680 --name web-admin tingcode/web-admin:latest
docker run --rm -d -p 80:80 -p 8081:8081 -p 8680:8680 --net host --name web-admin tingcode/web-admin:latest
30 changes: 16 additions & 14 deletions .github/workflows/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ http {
# 监听的端口
listen 80;
# 服务器名称
server_name localhost;
server_name 139.199.173.241;

location / {
if ($request_filename ~* .*\.(?:htm|html)$) ## 配置页面不缓存html和htm结尾的文件
Expand Down Expand Up @@ -86,9 +86,21 @@ http {
# 监听的端口
listen 8680;
# 服务器名称
server_name localhost;
server_name 139.199.173.241;
# location /docs 则最后不加/
# location /docs/ 则最后加/
location / {
if ($request_filename ~* .*\.(?:htm|html)$) ## 配置页面不缓存html和htm结尾的文件
{
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
}
# 把匹配到的路径重写, 注意要以/结尾
root /usr/share/nginx/html/docs;
# 默认首页
index index.html;
# 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html
try_files $uri $uri/ /index.html;
}
location /docs {
if ($request_filename ~* .*\.(?:htm|html)$) ## 配置页面不缓存html和htm结尾的文件
{
Expand All @@ -98,18 +110,8 @@ http {
alias /usr/share/nginx/html/docs;
# 默认首页
index index.html;
try_files $uri $uri/ /docs/index.html;
}
# 定义 404 页面
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}

# 定义 50x 页面
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
# 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html
try_files $uri $uri/ /index.html;
}
}
}
Expand Down

0 comments on commit 1454d8a

Please sign in to comment.