Jenkins behind nginx without subdirectory Jenkins behind nginx without subdirectory jenkins jenkins

Jenkins behind nginx without subdirectory


Then change:

proxy_pass http://localhost:8090;

to

proxy_pass http://localhost:8090/jenkins/;

Reference: http://nginx.org/r/proxy_pass


It seems to me the problem is the Glassfish configuration.

How about setting in application.xml the following value:

<context-root/>

Instead of the default, which is the name of the WAR file, without the .war extension.

There seems to be similar questions on SO.


From http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass

location / {    rewrite    /jenkins/(.*) /$1 break;    proxy_pass http://localhost:8090/jenkins/;    proxy_set_header        Host $host;    proxy_set_header        X-Real-IP $remote_addr;    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;}