Reverse Proxy Broken (mod_jk)

150 views
Skip to first unread message

Marcos Rey

unread,
Mar 11, 2015, 6:37:45 AM3/11/15
to jenkins...@googlegroups.com
Hello!

I've been reading the messages around the list and I see that more people see this message on 'Manage Jenkins' when running apache+mod_jk with Jenkins. Any input would be greatly appreciated.

Regards,



Rui Fernando Hayashi

unread,
Mar 11, 2015, 5:25:13 PM3/11/15
to jenkins...@googlegroups.com
I've managed to solve that using mod_proxy_ajp.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/c66b22b3-b92b-440b-be5c-97be4e2e2d40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Eggers

unread,
Mar 11, 2015, 7:54:57 PM3/11/15
to jenkins...@googlegroups.com
I've not seen this.

For my Jenkins URL:

http://[hostname]/jenkins/

In my uriworker.properties file:

/jenkins|/*=[workername]

Then in the Apache HTTPD host that manages Jenkins:

JkMountFile conf.d/uriworkermap.properties

There's a good base workers.properties configuration example in conf subdirectory of the mod_jk source code.

I'm running 1.602 on CentOS 6.6, Apache HTTPD 2.2.15-39, mo_jk 1.40, Tomcat 7.0.57, and Oracle JRE 1.7.0_76 64 bit. I'm using the APR connector (Tomcat native compiled and in Java library path). All my connectors are set to UTF-8.

. . . just my two cents
/mde/

Marcos Rey

unread,
Mar 12, 2015, 4:14:49 AM3/12/15
to jenkins...@googlegroups.com
Thanks Rui, i would consider mod_ajp. The weird thing is that i have a similar production deployment that does not have this issue.

Mark, thanks for sharing your config, mine is quite similar, but I still get the proxy reverse broken error. The weird thing is that everything seems to be working fine, so I might skip this for the meanwhile. Also, could you please verify that your installation passes the 'curl' test?


Also, I'm using https... I'm not sure if that's what's causing the issue.

Thanks both for your help and for taking your time to answer.

Marcos Rey

unread,
Mar 12, 2015, 4:16:51 AM3/12/15
to jenkins...@googlegroups.com

Daniel Beck

unread,
Mar 12, 2015, 4:47:08 AM3/12/15
to jenkins...@googlegroups.com
That's why the curl command specifies a referer, something you don't have if you just open that URL.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ce205e87-be25-4b28-b033-8c70268e0ecb%40googlegroups.com.

Marcos Rey

unread,
Mar 12, 2015, 4:55:59 AM3/12/15
to jenkins...@googlegroups.com, m...@beckweb.net

You are totally right, my bad. If I try the curl test, I get a 404 (as expected).

Marcos Rey

unread,
Mar 12, 2015, 5:00:28 AM3/12/15
to jenkins...@googlegroups.com, m...@beckweb.net

Forgot to append the output:

HTTP/1.1 302 Found
Date: Thu, 12 Mar 2015 08:57:51 GMT
Server: Apache/2.2.15 (CentOS)
Cache-Control: private
Expires: Thu, 01 Jan 1970 01:00:00 CET
Content-Length: 0
Connection: close
Content-Type: text/plain; charset=UTF-8

HTTP/1.1 404 Not Found
Date: Thu, 12 Mar 2015 08:57:52 GMT
Server: Apache/2.2.15 (CentOS)
Content-Length: 442
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /jenkins/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/https://hostname/jenkins/manage/ was not found on this server.</p>
<hr>
<address>Apache/2.2.15 (CentOS) Server at hostname Port 443</address>
</body></html>

Mark Eggers

unread,
Mar 12, 2015, 12:54:52 PM3/12/15
to jenkins...@googlegroups.com, m...@beckweb.net
I get the 404, but I don't get any errors on the management pages.

I don't think that referring to mod_jk as a proxy is strictly correct. See the following for a detailed explanation.


As an aside - mod_proxy_ajp is basically mod_jk. It's just that the configuration is different (both use AJP/1.3 under the covers).

You may run into some problems if you're serving Jenkins from differing contexts. For example:

1. Web server - http://hostname/ --> gets to Jenkins
2. Tomcat     - http://hostname:8080/jenkins/ --> gets to Jenkins

In those cases you'll probably have to do some rewriting.

I haven't done extensive Jenkins programming, so I don't know if my setup breaks for any of the use cases mentioned here:


I've also not trolled through all the pages to see if the Location header is being rewritten properly (no port 8080). However, I suspect that it is since the site works.

The only issue I'm observing is that pages representing modules in multi-module builds aren't being rendered correctly in Chrome. Much of the formatting and hyperlinks are missing. However, the same pages render correctly in Firefox. I suspect it's a Chrome vs. Jenkins issue.

. . . . just my two cents
/mde/


Marcos Rey

unread,
Mar 13, 2015, 5:34:51 AM3/13/15
to jenkins...@googlegroups.com, m...@beckweb.net

Yeah, that's my thought too. What buggers me is that my prod deployment passes the curl test and (in theory) I have the same configuration. The only difference is that apache also servers in port 80 while in the new installation only serves on 443 (https).  Anyway, for the meanwhile all is working fine so I guess I will have to live with it. Supposedly, mod_jk and ajp take care of everything so unless I start seeing something game-breaking I will leave it like this.

Anyway, thanks for your replies Mark, and in case I make some progress on this I will post again :)

Daniel Beck

unread,
Mar 13, 2015, 6:38:44 AM3/13/15
to jenkins...@googlegroups.com

On 13.03.2015, at 10:34, Marcos Rey <sole...@gmail.com> wrote:

> The only difference is that apache also servers in port 80 while in the new installation only serves on 443 (https).

Make sure the Jenkins URL in the global config is configured to point to HTTPS (and is identical to how you access Jenkins with your browser, same protocol, host name etc.).

Marcos Rey

unread,
Mar 17, 2015, 3:56:04 AM3/17/15
to jenkins...@googlegroups.com, m...@beckweb.net
Yep, that's covered, but still not making progress
Reply all
Reply to author
Forward
0 new messages