JNLP agent and proxy

25 views
Skip to first unread message

Simon Richter

unread,
Jan 23, 2020, 7:59:38 AM1/23/20
to jenkins...@googlegroups.com
Hi,

I'd expect this to be somewhat obvious, but it doesn't seem to be: I have a
JNLP agent on a Windows VM that should talk to the Jenkins master on
another VM in the same network. The Jenkins master has a standard nginx
proxy before it to allow external requests to come in.

The agent now connects to the proxy, requests connection information,
receives the port number and connects to the proxy's IP address with the
port number it received from the master.

Obviously this fails because the proxy does not forward the internal agent
ports (these are not supposed to be externally visible).

Is there a way to let the Jenkins master hand out not only the port number
but also the correct IP address to agents (after all, being run behind a
proxy seems to be a very common use case to the extent that the public URL
is configurable)?

Simon

Jeff Thompson

unread,
Jan 23, 2020, 1:23:45 PM1/23/20
to jenkins...@googlegroups.com

On the agent (node) configuration page when configuring to "Launch agent by connecting it to the master" there is an Advanced button. If you click that, one option that becomes visible is "Tunnel connection through". This *might* work for you. Read the inline help and try it to see if it meets your needs.

Another thing that might work for you soon is the the upcoming WebSocket connection mechanism ( https://github.com/jenkinsci/jep/blob/master/jep/222/README.adoc ). Looks like it's currently targeted towards the next weekly.

Jeff

Simon Richter

unread,
Jan 23, 2020, 1:33:26 PM1/23/20
to jenkins...@googlegroups.com
Hi,

On Thu, Jan 23, 2020 at 11:23:22AM -0700, Jeff Thompson wrote:

> If you click that, one option that becomes visible is "Tunnel
> connection through". This *might* work for you. Read the inline help
> and try it to see if it meets your needs.

Perfect, that seems exactly like what I need. I'll see whether it works
after the current long-running build completes. :)

Simon

James Nord

unread,
Jan 29, 2020, 4:37:01 PM1/29/20
to Jenkins Users
if you can access the server bypassing the reverse proxy (recommended) you need to configure Jenkins to advertise it's address

https://wiki.jenkins.io/plugins/servlet/mobile?contentId=38929503#content/view/38929503

hudson.TcpSlaveAgentListener.hostName

Reply all
Reply to author
Forward
0 new messages