Jenkins reverse proxy on IIS

1.5k Views Asked by At

enter image description hereI am configuring reverse proxy for jenkins on IIS 10. I get 500 - Internal server error.URL Rewrite Module Error. and Jekins shows the message "It appears that your reverse proxy set up is broken". I have added inbound and outbound rules with "localhost", IP Address and with host name as well. Is there anything else specific to IIS I need to configure?

1

There are 1 best solutions below

0
On

I also have "It appears that your reverse proxy set up is broken", but everything works fine (i.e. I can access my Jenkins instance from another computer without any issues).

My setup is as follows:

Path Prefix

In jenkins.xml I have provided the prefix I want to have for my Jenkins instance:

  <arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war" --prefix=/jenkins</arguments>

IIS configuration

web.config for the web site that should be used as a reverse proxy looks the following:

<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="(jenkins.*)" />
                    <action type="Rewrite" url="http://localhost:8080/{R:1}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

This assumes that Jenkins runs on its default port: 8080.

Not sure, but I think that Configure -> Jenkins location -> Jenkins URL should point to something like http://your_host_name/jenkins.

Of course, Web site bindings should include your hostname to access Jenkins from another machine.