Jump to content

Web admin - IIS Rewrite


Recommended Posts

Hi,

We've finally updated to a newer version with the web admin, and would like to make use of it.  We have things like Trac and Jenkins running on this server also.

Each one of these, as with Plastic, has their own inbuilt web server, so instead of having a myriad of ports open we instead use IIS to front them all and rewrite the URLs.  This works fine for both Trac and Jenkins, as they have options that let you specify exactly what the external URL of the system looks like.

I've not found a similar option for Plastic however, so when we attempt to access the box via, eg http://our.server/plastic, it successfully responds with the 302 to take us to the login page, but because it's unaware that it was not the root of the website, that 302 sends us to http://our.server/account.  Similarly if I attempt to directly open http://our.server/plastic/account, the page doesn't render properly as all the other resources requested after the initial page load are all requested from the root of the website, rather than relative to the page.

I could probably fix this with further rules in IIS to modify the responses to take this into account, but I'm wondering if there's a simple option I'm overlooking that would let me just put in the root url into the config somewhere, in the same way other tools can.  I've tried modifying the "override host name" option on the Network configuration in web admin, but it doesn't appear to apply to this.

Cheers,

James

Link to comment
Share on other sites

  • 5 months later...

Ok. I just had another go on this and managed to get it running 😃

Make sure you have IIS10 + AAR + Url Rewrite

1. Make sure you disable "Reverse rewrite host in respose headers" in "Application Request Routing Cache" -> "Server Proxy Settings..." (Server setting!!)

2. Create a new WebSite (if not already done)

3. Add a new application to the site (in my case the application is called 'plastic')

4. copy the attached web.config to the root folder of the web application

5. change all rules to the servernames and ports you are using

[PLASTICSERVER] is the name of the server that runs plastic scm.

[WEBSERVER] is the name of the web server.

Can be the same, but don't have to.

 

DONE ❤️

web.config

Link to comment
Share on other sites

Glad you got it working!

Since I posted this, we've started building a new dev server.  Like our old one, it's hosted in AWS.  However to "fix" this problem (more like work around it entirely), I've used AWS target groups and a load balancer, coupled with subdomains of the server domain.  Now we have eg https://plasticadmin.server.ourdomain and https://jenkins.server.ourdomain set up in Route 53 pointing at the load balancer, and the load balancer listener rules and target groups take care of routing to the right http port on the server.  It doesn't load balance anything since there's only 1 server behind it, but it makes this stuff trivial :) 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...