Use Apache to proxy through NGINX to MediaCMS (Server Install.) #939
Ben-A-Robinson
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am no linux guru but I was able to cobble this together after several days of researching. There was no single source of information and it was hit or miss with slow progress. Since I am already running Apache I did not want to re-invent everything in NGINX or use it as a proxy to Apache. I found no configurations for Apache to run MediaCMS directly. I am running an OPNsense router with HAProxy so I could have used it to redirect to NGINX running SSL on another port (say 10443) but I did not want to complicate the network or try to remember how it works if I made changes later and broke it.
This works by setting up Apache to proxy my subdomain media.example.com on (HTTPS) port 443 to the HTTP port 8080 on NGINX using the mediacms.io conf file. Also the MediaCMS file settings.py has to be modified so you don’t get a nasty CSRF error.
Hope this helps anyone else who may need to do the samething. Sorry but I will be of little help if it does not work for you.
Cheers!
-Ben
Ubuntu 20.04.6 LTS
Apache Apache/2.4.41 (Ubuntu)
nginx/1.18.0 (Ubuntu)
MediaCMs v3.1.0
Create Apache site conf file:
Enable new site:
a2ensite site_name_you_created
Enable Apache module:
a2enmod proxy_http
systemctl reload apache2
NGINX sites-available mediacms.io:
systemctl reload nginx
MediaCMS settings file change:
settings.py: add CSRF_TRUSTED_ORIGINS = ['https://media.example.com']
systemctl restart mediacms
Cross your fingers…
Beta Was this translation helpful? Give feedback.
All reactions