I am currently working on the AWS EMR service which uses the emr/jupyter-notebook Docker Image for Jupyterhub with Port 9443. The url “https://my-domain.com:9443” works. What I want is that when the user opens the url “http://my-domain.com”, then the user should be directed to a working url with port 9443.
I have looked around the answer for this. And one of the suggested answer was to make a change in the jupyterhub_config.py file.
The jupyterhub_config.py file content, where I have added the redirect for port 80. But that doesn’t work, because I am assuming this redirects to the HTTPS url without the port. Not sure though.
I can install nginx server in the instance. Is there any document which you can share which can help me with this. Also, could please elaborate on “redirection on the other port could happen under the hood”?
Following on @1kastner’s response - there are many ways to do this. Can you say a bit more about your setup and also if you have any familiarity doing http redirects in other ways? To get things working, I would stick with whatever you’re comfortable with - and it’s fine if you have multiple proxies running (they won’t affect performance much).
You may be missing the --redirect-to argument in this case. The underlying proxy server here is nice because it has an API to query it - and you can use it directly. If you want a Python interface, at gigantum we wrote this small Python class to query the configurable-http-proxy at runtime, which you’re welcome to copy from (it’s MIT licensed). You may or may not be aware that this is a package you can install and run separately?
But without knowing more about what you can (easily) do, it’s hard to provide a strong recommendation!
But this didn’t worked. The container stops working automatically.
To be honest, I haven’t worked much on http redirects. Although I would have preferred making changes only in jupyterhub_config.py file or but if that’s not the case and if you could guide me in the right direction, then I can probably work on this.
Regarding the setup, I am using the AWS EMR service for comes with a docker image emr/jupyter-notebook for JupyterHub(1.0.0) for multi-user login. I am not sure if this answers your question on the setup.
Also I am new to this service and I probably don’t know how the underlying proxies work in AWS EMR.
Also thanks for sharing the information on the Python class you guys have created(need to check with the team) and the package details. Regarding the package, how is it different from using the configuration in jupyterhub_config.py file.
Not sure whether I make sense on the questions I have asked, but thanks for the patience.
But in ANY case, I would ensure that you have a server up and running, and start by configuring your own proxy first (you can just run configurable-http-proxy from the command line once it’s installed). Then if you want to integrate it into your Jupyter configuration you can. This will make your debugging more direct and efficient.