Skip to content

Commit a693233

Browse files
committed
fix: nginx 404 bug
1 parent f3fb99e commit a693233

2 files changed

Lines changed: 2 additions & 37 deletions

File tree

.github/workflows/docker-build.yml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -69,39 +69,3 @@ jobs:
6969
path: |
7070
dist/
7171
retention-days: 7
72-
73-
test-image:
74-
name: Test Docker Image
75-
runs-on: ubuntu-latest
76-
needs: build-and-push
77-
if: github.event_name != 'pull_request'
78-
79-
steps:
80-
- name: Checkout repository
81-
uses: actions/checkout@v4
82-
83-
- name: Set up Docker Buildx
84-
uses: docker/setup-buildx-action@v3
85-
86-
- name: Build test image
87-
uses: docker/build-push-action@v5
88-
with:
89-
context: .
90-
file: ./Dockerfile
91-
platforms: linux/amd64
92-
push: false
93-
tags: ${{ env.IMAGE_NAME }}:test
94-
95-
- name: Test container health
96-
run: |
97-
docker run -d --name test-app -p 8080:80 ${{ env.IMAGE_NAME }}:test
98-
sleep 10
99-
100-
# Test health endpoint
101-
curl -f http://localhost:8080/health || exit 1
102-
103-
# Test main page
104-
curl -f http://localhost:8080/ || exit 1
105-
106-
docker stop test-app
107-
docker rm test-app

nginx.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ server {
1111

1212
# 静态资源缓存
1313
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
14+
root /usr/share/nginx/html;
1415
expires 1y;
1516
add_header Cache-Control "public, immutable";
1617
}
@@ -28,4 +29,4 @@ server {
2829
return 200 "healthy\n";
2930
add_header Content-Type text/plain;
3031
}
31-
}
32+
}

0 commit comments

Comments
 (0)