feat(admin): set /admin base path for reverse proxy deployment

Configure Vite base, Vue Router history, axios baseURL and container
Nginx to serve the admin panel under /admin/ path prefix.

🤖 Generated with [Qoder][https://qoder.com]
This commit is contained in:
2026-06-09 09:18:16 +08:00
parent 5279a7f831
commit b1ef7dc6f9
5 changed files with 25 additions and 7 deletions

View File

@@ -9,9 +9,8 @@ server {
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
location /api/ {
set $api_upstream api:3000;
proxy_pass http://$api_upstream;
location /admin/api/ {
proxy_pass http://api:3000/api/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@@ -19,7 +18,11 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;
}
location /admin/ {
try_files $uri $uri/ /admin/index.html;
}
location / {
try_files $uri $uri/ /index.html;
return 301 /admin/;
}
}