Welcome! Log In Create A New Profile

Advanced

proxy pass with rewrite

Philipp Kraus
October 25, 2013 01:58AM
Hello,

I would like to configure ngix with jenkins, nginx should be a proxy for the jenkins instance. I have configuration the proxy pass options in this way:

location /jenkins {
proxy_pass http://localhost:8080/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

My jenkins instance uses the port 8080 and I would like to pass the data from the URL http://mydomain/jenkins to the jerkins instance.
If I change the location to / everything works fine, but with the subdirectory alias I get an error with the URL. Jenkins result pages uses only
URLs to http://mydomain/<jenkins part> but in my case it should be http://mydomain/jenkins/<jenkins data>
I have modified the Jenkins URL (in the admin panel) to http://mydomain/jenkins/ but it seems to be an error on the reverse data call.
I must substitute all URL, which comes from the proxy_pass URL with http://mydomain/jenkins
How can I do this in a correct way?

Thanks

Phil
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

proxy pass with rewrite

Philipp Kraus October 25, 2013 01:58AM

Re: proxy pass with rewrite

Francis Daly October 25, 2013 04:02AM

Re: proxy pass with rewrite

Philipp Kraus October 25, 2013 07:26AM

Re: proxy pass with rewrite

Francis Daly October 25, 2013 07:44AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 313
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready