I have a Windows Server 2012-R2 Server running Nexus Repository OSS on localhost:8081
. I configured a Reverse Proxy in IIS with the following rule:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://localhost:8081/{R:1}" />
</rule>
</rules>
<outboundRules>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
</system.webServer>
</configuration>
When I access the site from another system and navigate to nexus.mycompany.com I can see the proxy working... mostly. All the dependent css, js, etc are all localhost:8081
which of course, a remote machine cannot resolve.
I tried adding an outbound rule hoping it would fix the issue, it did not.
<rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
<match filterByTags="A, Form, Img" pattern="^http(s)?://localhost:8081/(.*)" />
<action type="Rewrite" value="http{R:1}://nexus.mycompany.com/{R:2}" />
</rule>
Looking at the documentation, I tried setting a base URL. The button it describes isn't in the GUI. I found a Stack Overflow article explaining that it's been moved to the Capabilities section. I added the base url through the capabilities, and it still doesn't work.
I have restarted the windows service after each change.
I want to do is have the repository available via a hostname and have it load appropriately. Am I missing something obvious here? Is there some other reason why it's using full URLs instead of relative URLs?