From e6579a34afbe20e66ce8e1b520dfc4d6e7831176 Mon Sep 17 00:00:00 2001 From: ulcheyev Date: Sun, 28 Jun 2026 20:53:53 +0200 Subject: [PATCH] [Upd] mediacms version update --- configs/mediacms/Dockerfile | 2 +- configs/mediacms/nginx.conf | 51 ++++++++++++++++++----- configs/nginx/static/partials/header.html | 2 +- configs/nginx/static/styles/variables.css | 2 +- 4 files changed, 43 insertions(+), 14 deletions(-) diff --git a/configs/mediacms/Dockerfile b/configs/mediacms/Dockerfile index 5356dfa..2f351b0 100644 --- a/configs/mediacms/Dockerfile +++ b/configs/mediacms/Dockerfile @@ -1,4 +1,4 @@ -FROM mediacms/mediacms:7.2 +FROM mediacms/mediacms:latest ARG MEDIACMS_HOME=/home/mediacms.io/mediacms ARG MEDIACMS_DOCKER_DIR=${MEDIACMS_HOME}/deploy/docker diff --git a/configs/mediacms/nginx.conf b/configs/mediacms/nginx.conf index 8443df5..9d6459d 100644 --- a/configs/mediacms/nginx.conf +++ b/configs/mediacms/nginx.conf @@ -1,30 +1,59 @@ server { listen 80; + server_name _; gzip on; + access_log /var/log/nginx/mediacms.io.access.log; error_log /var/log/nginx/mediacms.io.error.log warn; - location /static { - alias /home/mediacms.io/mediacms/static; + client_max_body_size 0; + + # Static frontend / Django static files + location /static/ { + alias /home/mediacms.io/mediacms/static/; + expires 7d; + add_header Cache-Control "public"; } - # Public entry point — goes through Django for auth check + # Public media entry point. + # This goes through Django/Gunicorn so auth middleware can decide + # whether the file may be served. location /media/ { - include /etc/nginx/sites-enabled/uwsgi_params; - uwsgi_pass 127.0.0.1:9000; + proxy_pass http://127.0.0.1:9000; + + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-Host $http_x_forwarded_host; + proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_redirect off; + proxy_request_buffering off; + proxy_buffering off; } - # Internal only — nginx serves file directly after X-Accel-Redirect + # Internal only. + # Django should return X-Accel-Redirect: /protected-media/ + # and then Nginx serves the real file directly. location /protected-media/ { - internal; # blocks direct browser access + internal; alias /home/mediacms.io/mediacms/media_files/; + + # Better video seeking / streaming behavior + add_header Accept-Ranges bytes; } + # Everything else goes to Django/Gunicorn location / { - include /etc/nginx/sites-enabled/uwsgi_params; - uwsgi_pass 127.0.0.1:9000; - } + proxy_pass http://127.0.0.1:9000; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-Host $http_x_forwarded_host; + proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -} + proxy_redirect off; + } +} \ No newline at end of file diff --git a/configs/nginx/static/partials/header.html b/configs/nginx/static/partials/header.html index 2561068..40f9628 100644 --- a/configs/nginx/static/partials/header.html +++ b/configs/nginx/static/partials/header.html @@ -1,7 +1,7 @@
-

Case Study Name

+

VITA Study

\ No newline at end of file diff --git a/configs/nginx/static/styles/variables.css b/configs/nginx/static/styles/variables.css index ec8f74a..784c119 100644 --- a/configs/nginx/static/styles/variables.css +++ b/configs/nginx/static/styles/variables.css @@ -1,5 +1,5 @@ :root { - --bg: #f4f6f8; + --bg: #f1f1f1; --surface: #ffffff; --surface-muted: #f8fafc; --surface-hover: #f3f7fb;