Closed imwexpex closed 4 years ago
Do we use the base url somewhere? Or what is the reason you want to change it?
Yep, as i see you use it at least for auth redirection.
try to login here with some bad creds: https://domjudge.digitalsheva.app/login
How have you set up the Docker container? I just tried setting it up using the default command and then adding an nginx proxy in front of it at https://dj.thuis.xept.nl/login . For me it doesn't redirect to localhost but to the site. My nginx proxy has no special config btw...
Just follow the instructions at https://hub.docker.com/r/domjudge/judgehost/ no special configuration included, all by default.
Also proxying with Nginx to localhost:12345 w/o special configuration.
Maybe it would be better if I will share some configs which will help you to find a problem?
Yes please, since I basically did the same and it worked.
What can I share that will help you?
OS: Ubuntu 16.4 Nginx Conf: https://pastebin.com/yZT2ngQ0
Default copy-paste command, nothing else.
docker run -v /sys/fs/cgroup:/sys/fs/cgroup:ro --link dj-mariadb:mariadb -it -e MYSQL_HOST=mariadb -e MYSQL_USER=user-e MYSQL_DATABASE=db -e MYSQL_PASSWORD=psswd -e MYSQL_ROOT_PASSWORD=rootpwd -p 12345:80 --name domserver domjudge/domserver:latest
I am lost... I checked my config and it is exactly the same...
What you can try is to set this in your location
block, maybe it helps:
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
Although I don't have these settings and it works for me. The only difference is that I am using Ubuntu 20.04 but I can't imagine that really being different.
Hi! Sorry for the delayed answer!
Setting just
proxy_set_header Host $http_host;
Helps!
Great! I will close the issue then. I will update the Docker readme at some point to add this there.
Hey! It would be nice if you could add some Enviroment BASE_URL to docker run, because of now there is no possibility to change localhost URL