diff --git a/Dockerfile b/Dockerfile index 552e26b..b21ef84 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,4 +2,4 @@ FROM alpine:latest RUN sed -i 's@dl-cdn.alpinelinux.org@mirrors.tuna.tsinghua.edu.cn@g' /etc/apk/repositories \ && apk add --no-cache nginx -CMD ["nginx"] +CMD ["nginx", "-g", "daemon off;"] diff --git a/compose.yaml b/compose.yaml index a0b4f75..6faf1d9 100644 --- a/compose.yaml +++ b/compose.yaml @@ -7,7 +7,8 @@ services: - "127.0.0.1:80:11451" volumes: - "./dist:/usr/share/nginx/html:ro" - - "./nginx.conf:/etc/nginx/nginx.conf" + - "./nginx.conf:/etc/nginx/nginx.conf:ro" + - "nginx_logs:/var/log/nginx:rw" restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost/health"] @@ -19,4 +20,7 @@ services: - surl-network networks: surl-network: + external: false +volumes: + nginx_logs: external: false \ No newline at end of file diff --git a/index.html b/index.html index 0778f03..ceb7d43 100644 --- a/index.html +++ b/index.html @@ -6,6 +6,8 @@ + + S-URL services diff --git a/nginx.conf b/nginx.conf index 1d5d9ae..f5ba9a1 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,9 +1,9 @@ #user nobody; worker_processes auto; -daemon off; +# daemon off; -#error_log logs/error.log; +error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; @@ -19,11 +19,11 @@ http { include mime.types; default_type application/octet-stream; - #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - # '$status $body_bytes_sent "$http_referer" ' - # '"$http_user_agent" "$http_x_forwarded_for"'; + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; - #access_log logs/access.log main; + access_log logs/access.log main; sendfile on; #tcp_nopush on; @@ -41,8 +41,8 @@ http { root /usr/share/nginx/html; #charset koi8-r; - #access_log logs/host.access.log main; - access_log off; + # access_log logs/host.access.log main; + # access_log off; location / { try_files $uri $uri/ /index.html; } diff --git a/src/components/views/DashboardView.vue b/src/components/views/DashboardView.vue index 5e38a86..8926bfe 100644 --- a/src/components/views/DashboardView.vue +++ b/src/components/views/DashboardView.vue @@ -1,5 +1,19 @@ @@ -38,6 +52,15 @@ const { t } = useLocale() + + + notice + you need to login + + ok + + + \ No newline at end of file diff --git a/src/router.ts b/src/router.ts index bf3a928..0bdd8eb 100644 --- a/src/router.ts +++ b/src/router.ts @@ -1,4 +1,4 @@ -import {createRouter, createWebHistory} from "vue-router"; +import {createRouter, createWebHistory, RouteRecordRaw} from "vue-router"; import Login from "./components/views/LoginView.vue"; import InputBox from "./components/items/InputBox.vue"; import IntroView from "./components/views/IntroView.vue"; @@ -11,7 +11,7 @@ import Security from "./components/items/Security.vue"; import UrlManagement from "./components/items/UrlManagement.vue"; import UrlAdd from "./components/items/UrlAdd.vue"; -const routes = [ +const routes: RouteRecordRaw[] = [ { path: '/', component: IntroView @@ -47,6 +47,9 @@ const routes = [ }, { path: '/404', component: NotFound + }, { + path: '/:pathMatch(.*)*', + redirect: '/404' } ] export const router = createRouter({