NGINX proxy_pass application for root site

Asked

Viewed 130 times

1

Good afternoon Personal,

I have a server with Docker swarm running on production, where my Nginx is playing the role of reverse proxy for Microservices. Everything is working perfectly, but I always come across the following problem with Nginx.

I need an application (like Jenkins or zanata for example) to fall at the root of my site, like below:

server {
server_name myapp.com
listen 80;

location / {
proxy_pass http://ipservidorjenkins/jenkins/;
}
}

above is just an example.. whenever I try to make a proxy_pass to an address that has URN (in the case of /Jenkins), failure, in Sso or gives 404, or in some cases does not load CSS and javascript.

Has anyone ever done this type of setup without having to add /Enkins to Location? The idea is to go to myapp.com and fall into http://ipservidorjenkins/Jenkins

Thank you!

  • Do you have any other location? When you define a location for caches settings, for example, the proxy_pass of root does not work. Ex: https://pastebin.com/0q8M773n

  • Hello Valdeir, I only have this Location, in which case my root would be the proxy_pass to the Jenkins server. I would have to add the configuration you passed (pe?g|gif|css|js|png|webp) to the Jenkins server as well?

  • Hello! Can you pass the real IP of the client through this Nginx? That is, can inform the real IP for client application.

1 answer

0

Hi! It shows error, because the parameter was not passed --prefix=/jenkins , when I started Jenkins. See this link as a reference.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.