Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configs/mediacms/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
51 changes: 40 additions & 11 deletions configs/mediacms/nginx.conf
Original file line number Diff line number Diff line change
@@ -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/<path>
# 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;
}
}
2 changes: 1 addition & 1 deletion configs/nginx/static/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<header class="gateway-header">
<div class="brand">
<div>
<h1>Case Study Name</h1>
<h1>VITA Study</h1>
</div>
</div>
</header>
2 changes: 1 addition & 1 deletion configs/nginx/static/styles/variables.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:root {
--bg: #f4f6f8;
--bg: #f1f1f1;
--surface: #ffffff;
--surface-muted: #f8fafc;
--surface-hover: #f3f7fb;
Expand Down