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:
@@ -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/;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user