From 109761ea94407e17b8eb9c5ddfd2da791c9f9b7b Mon Sep 17 00:00:00 2001 From: bartool Date: Sun, 30 Nov 2025 00:02:11 +0100 Subject: [PATCH] fix: update static file handling and proxy settings in Django and Nginx configuration --- backand/MPM/settings.py | 5 ++++- frontend/nginx.conf | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/backand/MPM/settings.py b/backand/MPM/settings.py index 48c46ce..d65def9 100644 --- a/backand/MPM/settings.py +++ b/backand/MPM/settings.py @@ -121,12 +121,15 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/5.2/howto/static-files/ -STATIC_URL = 'static/' +STATIC_URL = '/mayo-manager/static/' STATIC_ROOT = BASE_DIR / "staticfiles" # Proxy settings USE_X_FORWARDED_HOST = True +USE_X_FORWARDED_PORT = True SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') +SECURE_SSL_REDIRECT = True + # CSRF Trusted Origins CSRF_TRUSTED_ORIGINS = os.getenv("CSRF_TRUSTED_ORIGINS", "").split(",") diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 0fff65b..0d179cd 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -38,7 +38,7 @@ http { # Serwowanie aplikacji Vue location /mayo-manager/ { alias /usr/share/nginx/html/; - try_files $uri $uri/ /mayo-manager/index.html; + try_files $uri $uri/ /index.html; } # Proxy do API Django