6

I am trying to use IIS with Application Request Routing as a reverse proxy for an instance of Jenkins running on the same host. The host is running Windows Server 2016 (Server Core).

Jenkins is running on localhost:8080 while the default IIS site (which I am using as the reverse proxy site) is on 10.0.0.84:80 I have managed to get URL rewrite to work as per this tutorial but it does not work with Jenkins' CSRF support and will report 403s due to the "Crumb" not being present.

I am assuming that I need some kind of outgoing rewrite rule to make this work properly. I have scoured the internet and haven't found anybody else who has got this working.

Andrew Mack
  • 136
  • 5
  • Did you get anywhere with this? I'm in similar boat with TeamCity... IIS proxying Apache. – Matt Canty Apr 18 '17 at 16:52
  • 1
    I never really got it working. I managed to track the issue to the fact that the CSRF check includes a URL embedded in a URL. When IIS parses the URL, it escapes it properly but passes it on unescaped. So the url might be https://your.jenkins.io/blahblah?ref=http%3A%2F%2Fyour.jenkins.io%2Fcsrf But if you ask for the "unescaped" version of the query URL, it just un-encodes the escaped version. This was about the point that I gave up, because wasn't familiar enough with the URL Rewrite rules and couldn't debug them without a huge hassle. If you do figure it out, I'd love to know. – Andrew Mack Apr 19 '17 at 20:28
  • Given our TeamCity server is on a private network I set `rest.cors.origins=*` in `C:\ProgramData\JetBrains\TeamCity\config\internal.properties`. This is a work-around to our problem, but more like shoving it under the carpet... – Matt Canty Apr 20 '17 at 15:34

0 Answers0