update Dockerfile and settings for static files handling; adjust nginx config for Django and Vue integration

This commit is contained in:
2025-11-29 22:49:25 +01:00
parent 6144c28855
commit 598b10b574
5 changed files with 35 additions and 25 deletions

View File

@@ -30,41 +30,35 @@ http {
listen 7080;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Serwowanie statycznych plików Django Admina
location /mayo-manager/static/ {
alias /static_django/;
}
# Serwowanie aplikacji Vue
location /mayo-manager/ {
try_files $uri $uri/ /index.html;
alias /usr/share/nginx/html/;
try_files $uri $uri/ /mayo-manager/index.html;
}
location ~* \.(?:ico|css|js|gif|jpe?g|png|woff2?|eot|ttf|svg|map)$ {
expires 1y;
access_log off;
add_header Cache-Control "public, immutable";
add_header X-Content-Type-Options nosniff;
}
# location /assets/ {
# expires 1y;
# add_header Cache-Control "public, immutable";
# add_header X-Content-Type-Options nosniff;
# }
# BACKEND API
# Proxy do API Django
location /mayo-manager/api/ {
proxy_pass http://mayo-production-manager-backend:7090/;
proxy_pass http://mayo-production-manager-backend:7090/api/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# DJANGO ADMIN
# Proxy do panelu admina Django
location /mayo-manager/admin/ {
proxy_pass http://mayo-production-manager-backend:7090/admin/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
error_page 404 /index.html;
error_page 404 /mayo-manager/index.html;
}
}