learn-nginx | Nginx Getting Started Guide | Proxy library
kandi X-RAY | learn-nginx Summary
kandi X-RAY | learn-nginx Summary
Nginx Getting Started Guide
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of learn-nginx
learn-nginx Key Features
learn-nginx Examples and Code Snippets
Community Discussions
Trending Discussions on learn-nginx
QUESTION
I know that similar questions have been asked, but none of the topics, articles and blogs that I found allowed me to resolve my issue. Let me be very straightforward and specific here:
1. What I have:
Docker Swarm cluster (1 local node), NGINX as a reverse proxy, and for the sake of this example: apache, spark, rstudio and jupyter notebook containers.
2. What I want:
I want to set up NGINX to that I can expose to the host only one port (80 - NGINX) and serve these 4 applications through NGINX over the same port (80) but different paths. On my local dev environment I want apache to be accesible on "127.0.0.1/apache", rstudio under "127.0.0.1/rstudio", spark UI under "127.0.0.1/spark" and jupyter under "127.0.0.1/jupyter". All these applications use different ports internally, this is not a problem (apache - 80, spark - 8080, rstudio - 8787, jupyter - 8888). I want them to use the same port externally, on the host.
3. What I don't have:
I don't have and won't have a domain name. My stack should be able to work when all I have is a public IP to the server or multiple servers that I own. No domain name. I saw multiple examples on how to do things that I want to do using hostnames, I don't want that. I want to acces my stack only by IP and path, for example 123.123.123.123/jupyter.
4. What I came up with:
And now to my actual problem - I have a partialy working solution. Concretely, apache and rstudio are working ok, jupyter and spark are not. By not I mean that jupyter redirections are causing problems. When I go to 127.0.0.1/jupyter I am being redirected to the login page, but instead of redirecting to 127.0.0.1/jupyter/tree, it redirects me to 127.0.0.1/tree, which of course does not exist. Spark UI won't render properly, beacuse all css and js files are under 127.0.0.1/spark/some.css, but spark UI tries to get them from 127.0.0.1/some.css and the same story is basically with all other dashboards
In my actual stack I have more services like hue, kafdrop etc. and none of them work. Actually the only things that work are apache, tomcat and rstudio. I'm suprised that rstudio works without problems with authentication, logging in, out etc. It is completely ok. I actually have no idea why it works, when everything else fails.
I tried to do the same with Traefik - same outcome. With traefik I could not even set up rstudio, all dashboards suffered the same problem - not properly loading static content, or dashboards with login page - bad redirects.
5. Questions:
So my questions are:
- are the things that I'm trying to acomplish even possible?
- if not, why using different hostnames makes it possible, but different paths on the same host do not work?
- if it is possible, then how should I set up NGINX to work properly?
My minimal working example is below: First initialize swarm and create network:
...ANSWER
Answered 2019-Jun-15 at 22:13I can't help with Jupyter and Spark but hope that this answer will help you.
If you plan to put something behind a reverse proxy, you should verify that it can work behind a reverse proxy, as you mentioned.
127.0.0.1/jupyter/tree, it redirects me to 127.0.0.1/tree
because for Jupyter root is /
, not /jupyter
, so you need to find in config how to change it, as an example for Grafana.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install learn-nginx
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page