With the SSL certificate, I setup an HTTP to HTTPS redirect in my web.config file, located in the wwwroot folder of my server.
- Code: Select all
<rule name="HTTP Redirect to HTTPS" enabled="true" stopProcessing="true">
<match url="(.*)" ignoreCase="true" />
<conditions>
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
Modules installed:
Application Request Routing
URL Rewrite
I used the following resources for my setup:
http://www.iis.net/learn/extensions/url-rewrite-module/reverse-proxy-with-url-rewrite-v2-and-application-request-routing
http://forum.wegotserved.com/index.php/tutorials/article/98-configure-iis-for-reverse-proxy/
Subsonic Settings:
Subsonic 5.0 is installed and is running on port 4040. The context path is also set to "/music".
Application Request Routing Settings:
In the ARR module, I selected "Enable proxy" and hit "Apply".
URL Rewrite:
Under the HTTP/HTTPS redirect rule in web.config, I added the following rule for "localhost/music/" to rewrite to "localhost:4040/music/".
- Code: Select all
<rule name="Subsonic 4040 Proxy Redirect" enabled="true" stopProcessing="true">
<match url="^music/(.*)" ignoreCase="true" />
<action type="Rewrite" url="http://localhost:4040/music/{R:1}" />
</rule>
Success! I can access "mydomain.com/music/" which then redirects to "https://mydomain.com/music/" and it loads subsonic as if I were accessing it as "mydomain.com:4040/music".
The only issue that I have is a small one, but is a nuisance. I cannot figure out how to access "mydomain.com/music" without having to include the last "/". I tried removing the slashes from the match and rewrite in my rule, but it only breaks it. Any ideas?
Mike