Replies: 11 comments
-
These two missing lines in the settings.py fixed it for me.
These lines instruct django to use the forwarded headers from the reverse proxy |
Beta Was this translation helpful? Give feedback.
-
@JustinBack Hello, thank you!
|
Beta Was this translation helpful? Give feedback.
-
Hi! Keep the lines as is in my comment above, don't change anything and it should work properly :-) Edit: Just saw that you tried the original one as well. Is nginx properly setting the x-forwarded-host and x-forwarded-proto header? |
Beta Was this translation helpful? Give feedback.
-
I'm not familiar with nginx, how can I check this? |
Beta Was this translation helpful? Give feedback.
-
Are you running the dockerized nginx proxy or running a locally installed nginx? I removed the dockerized nginx proxy as it caused a couple of issues but here is my nginx config: server {
server_name my.server.tld;
client_max_body_size 5G;
charset utf-8;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_pass http://localhost:8012; # 8012 being the forwarded port of the web container in docker
}
listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/my.server.tld/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/my.server.tld/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = my.server.tld) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name my.server.tld;
listen [::]:80;
listen 80;
return 404; # managed by Certbot
} |
Beta Was this translation helpful? Give feedback.
-
Hello, I'm running locally installed nginx and use an Apache2 revert proxy |
Beta Was this translation helpful? Give feedback.
-
Here is a diagram of my reverse proxy configuration: |
Beta Was this translation helpful? Give feedback.
-
Hi, when your Browser Console responds something like this you can try adding the following lines to your Apache Site Config:
That worked for me. Heres my full config file:
Unfortunately, it only works if you are logged in. I have written more about this here: #502 |
Beta Was this translation helpful? Give feedback.
-
Hey, thanks for your repply! |
Beta Was this translation helpful? Give feedback.
-
HI there, same issues here with a nginx proxy manager (reverse proxy) and a new ubuntu 20 stand alone server/install based on this tutorial. https://theitguycj.com/self-host-and-share-your-videos-audio-and-pictures-with-mediacms/ my current setup is showing the same half broken pages https://media.bluegoat.ca i tried adding ALLOW_ANONYMOUS_ACTIONS = [] to local_settings.py and restarted. no change. |
Beta Was this translation helpful? Give feedback.
-
Just wanted to say Thank You to JustinBack. Your additional two lines (as he has them printed) and your reverse proxy config alleviated issue of links not working. Now if I can just get uploaded video to play back through the proxy I will be set! |
Beta Was this translation helpful? Give feedback.
-
Describe the issue
Hello, I self-host my servers and to do this I use port forwarding and a reverse proxy.
I noticed that the home page does not display when going through the proxy address, same for user profiles or uploading videos, there is an infinite loading screen.
As soon as I go back to the local ip or the public ip, everything works correctly, how can I fix the problem? Is there an additional port to open besides port 80 and 443?
To Reproduce
Steps to reproduce the issue:
Screenshots
Environment (please complete the following information):
Other
I use Apache2 for the reverse proxy
Beta Was this translation helpful? Give feedback.
All reactions