-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem pulling from behind a proxy #391
Comments
Did you deploy in the docker-compose containers or directly on the node? |
Docker-compose |
So there are probably a few options. Arguably if Singularity honors the redirect (302) this would work out of the box, so you could open an issue on the Singularity repo and ask if that might be possible. Otherwise, you will need some kind of proxy between the container and client to say "this is actually being served from this url." I have never deployed in this context so I don't have a recipe for you, but my suggestion would be to tweak the nginx.conf to see if you can create the proxy for your specific setup. https://www.digitalocean.com/community/tutorials/understanding-nginx-http-proxying-load-balancing-buffering-and-caching. If I were you I'd go about doing this by:
rinse and repeat until you get something working! And if you do, please share here so we can update docs with a recipe for the next person. |
Sadly steps 1 - 3 are exactly what I have been doing for about a week now. I'll keep throwing stuff at the wall. I will keep this issue open until I finally admit defeat. |
Well let's poke in other communities then to ask for help! This indeed must be something others have faced. I'll poke around some of my discussions channels - there must be an nginx.conf that will do the trick, and we just have to find it! |
Huh, if you see that the uwsgi gets a hit, that does suggest that it's hitting the server - the question is where are you redirecting to? Are you able to get more detailed output from the Singularity client to perhaps print headers that are returned (e.g., there might be a Location header that shows the redirect). Django sometimes has this thing where it will redirect http to https, and that could be happening here, in which case you'd want to deploy with https. But maybe if you can figure out where it's redirecting that will get us one step closer to understanding what's going on, and if it's an issue with the registry configuration or something else. |
I have https deployed. |
Are you using the https nginx.conf and are all the redirects also https? I ask because if Django is set to redirect to https, you would get a redirect (this has happened to me before). I would check out this section https://docs.djangoproject.com/en/4.0/topics/security/#ssl-https of the docs because perhaps some of the settings.py options you could try to set. If we can just see what the header says it would be helpful to see if it's trying to do something around that! |
I am using the https nginx.conf, but the only redirect I have edited is in I can confirm that all traffic is going through https though. Which is expected because don't Glancing at the docs you just sent over now |
I think an option was added recently to not require it - I always used to edit and then compile the source code to disable it for local development! But if somehow it's going through https -> http -> https (django) if that's even possible via the proxy you have setup, I think you could see that error. I would also check out this particular setting - I've never used it before but it seems to be specific for a proxy! https://docs.djangoproject.com/en/4.0/ref/settings/#std:setting-SECURE_PROXY_SSL_HEADER |
Dumb question (I don't mess with Django much) where should I set these settings? I am assuming somewhere in shub/settings, but can |
config.py works! And you'll need to restart the containers each time, assuming you are using the docker-compose that binds everything to /code. It normally is just a single settings.py file, and for some reason I thought it would be better to have the settings module splot out over a bunch of files. I think it does make it easier to say "just edit config.py!" but also probably is more confusing to not find settings.py. I'm poking more around Django docs - I would also try:
last section here (the main article is for apache but the concept is similar) https://ubuntu.com/blog/django-behind-a-proxy-fixing-absolute-urls. And maybe if the tools you are using don't work, just trying a requests.get() (in python) for a basic server endpoint to see what it returns? E.g., when you try to browse to the UI do you see it? Another blog about it with a TLDR here: https://medium.com/@rui.jorge.rei/today-i-learned-nginx-reverse-proxying-for-django-projects-3ab17ad707f6 |
As far as I'm aware, Wireshark won't help you if tcpdump doesn't: you'll need to actually engage with HTTPS to get the HTTP request headers. I'd suggest pointing curl directly at the URL from the uwsgi log, to manually get a look at the headers and request progress, e.g.:
|
I have been beating my head against this issue for some time now. This registry is installed on a compute node on an HPC cluster. All http(s) is proxied through the frontend of the cluster.
From the host machine, pushes work fine, but when I try to pull from the host I get:
It seems like the redirect url is not pointing to the correct location for download?
I have recreated the exact install steps on a local desktop and everything worked out of the box. So this nil redirection issue is specific to the cluster installation of this registry.
Has anyone seen this issue before? I'd imagine it is a
uwsgi
/proxy
setting that I need to set somewhere?The text was updated successfully, but these errors were encountered: