Merge pull request #8 from shadowofmoo/main

解决使用docker部署搜索404的问题
This commit is contained in:
KoriIku 2024-10-09 17:35:14 +08:00 committed by GitHub
commit 2393f8c456
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 0 deletions

View File

@ -1,4 +1,5 @@
FROM nginx:1.27
COPY ./conf/nginx.conf /etc/nginx/conf.d/default.conf
COPY ./dist/ /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

17
conf/nginx.conf Normal file
View File

@ -0,0 +1,17 @@
server {
listen 80;
listen [::]:80;
server_name localhost;
access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

View File

@ -3,6 +3,7 @@ import Home from '@/components/Home.vue'
import Results from '@/components/Results.vue'
const router = createRouter({
mode: "history",
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{