# Reverse Proxy Test does not handle URL correctly

**URL:** <https://community.jenkins.io/t/reverse-proxy-test-does-not-handle-url-correctly/1294>\
**Category:** Ask a question\
**Created:** [January 20, 2022, 4:12pm UTC](https://community.jenkins.io/t/reverse-proxy-test-does-not-handle-url-correctly/1294 "2022-01-20T16:12:34Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![juhale](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@juhale](https://community.jenkins.io/u/juhale)\
**Post date:** [September 23, 2023, 6:03am UTC](https://community.jenkins.io/t/reverse-proxy-test-does-not-handle-url-correctly/1294/13 "2023-09-23T06:03:54Z")

</div>

Hi!

**EDIT: This has been solved, again s##### user error. I’m leaving the rest just for anybody having the same problem and googling their way here**

The root cause for this issue is indeed a configuration problem. My configuration was the following:

```auto
        # Jenkins
        location / {
            proxy_pass http://dockerserver.domain:8088/;
            proxy_redirect default;
            proxy_http_version 1.1;

```

And it should be the following (remove the slash after the url):

```auto
        # Jenkins
        location / {
            proxy_pass http://dockerserver.domain:8088;
            proxy_redirect default;
            proxy_http_version 1.1;

```

When the url ends with a slash, `nginx` will urldecode it and the Stapler no longer parses the parameters to the test correctly. More comments on the nginx behaviour [here](https://stackoverflow.com/questions/28995818/nginx-proxy-pass-and-url-decoding).

Thanks a lot for all the other reporters and especially to you who took your time to answer the questions.

* * *

I’m having the same issue. Jenkins reports that the reverse proxy configuration is invalid, even though I have copied the example settings for Nginx. I have a public-facing proxy server with nginx and a `jenkins/jenkins:lts-jdk17` container running on a different server, exposing port for the reverse proxy.

Technically, `ReverseProxySetupMonitor/test` does a 302 redirect to `ReverseProxySetupMonitor/testForReverseProxySetup/` and gives the referer as a parameter. Then, the latter method checks the parameter given and the referrer are the same. So far understandable.

But when I added logging for what Stapler did, i saw the following:

```auto
Sep 23, 2023 5:54:23 AM FINE org.kohsuke.stapler.Stapler
Processing request for /administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/https:/jenkins.domain/manage/
Sep 23, 2023 5:54:23 AM FINE org.kohsuke.stapler.Dispatcher
-> evaluate(<hudson.model.Hudson@73436f> :hudson.model.Hudson,"/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/https:/jenkins.domain/manage")
Sep 23, 2023 5:54:23 AM FINE org.kohsuke.stapler.Dispatcher
-> evaluate(((StaplerProxy)<hudson.model.Hudson@73436f>).getTarget(),"/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/https:/jenkins.domain/manage")
Sep 23, 2023 5:54:23 AM FINE org.kohsuke.stapler.Dispatcher
-> evaluate(<hudson.model.Hudson@73436f>.getAdministrativeMonitor("hudson.diagnosis.ReverseProxySetupMonitor"),"/testForReverseProxySetup/https:/jenkins.domain/manage")
Sep 23, 2023 5:54:23 AM FINE org.kohsuke.stapler.Dispatcher
-> evaluate(<hudson.diagnosis.ReverseProxySetupMonitor@56f94fa4> :hudson.diagnosis.ReverseProxySetupMonitor,"/testForReverseProxySetup/https:/jenkins.domain/manage")
Sep 23, 2023 5:54:23 AM FINE org.kohsuke.stapler.Dispatcher
-> evaluate(((StaplerProxy)<hudson.diagnosis.ReverseProxySetupMonitor@56f94fa4>).getTarget(),"/testForReverseProxySetup/https:/jenkins.domain/manage")
Sep 23, 2023 5:54:23 AM FINE org.kohsuke.stapler.Dispatcher
-> evaluate(<hudson.diagnosis.ReverseProxySetupMonitor@56f94fa4>.getTestForReverseProxySetup("https:"),"/jenkins.domain/manage")
Sep 23, 2023 5:54:23 AM WARNING hudson.diagnosis.ReverseProxySetupMonitor getTestForReverseProxySetup
https://jenkins.domain/manage vs. https:

```

So, Stapler, or something before Stapler, urldecodes the parameter and starts the evaluation chain after that. The end result is, that while the parameter is correct in url (except that `https://` has changed to `https:/`), it does not get passed as a parameter as whole - the rest of the url is left out from the call as a second parameter.

Now I’m 98% sure that this is not how it should work.

---

_[View the full topic](https://community.jenkins.io/t/reverse-proxy-test-does-not-handle-url-correctly/1294)._
