1 Dynmap With IIS Using URL Rewrite and applicationrequestrouting thanks to kekec852
FedUpWith-Tech edited this page 2020-08-01 16:00:55 -04:00

This page assumes:

Start:

  • To start, create the directory C:\Inetpub\wwwroot\dynmap.
  • Copy the contents of the web directory found in the repository to C:\Inetpub\wwwroot\dynmap.

There are two choices:

  • Create folder C:\Inetpub\wwwroot\dynmap\tiles\ and edit configuration.txt and make sure you have the property tilespath set to C:\Inetpub\wwwroot\dynmap\tiles\:
# The path where the tile-files are placed.
tilespath: C:\Inetpub\wwwroot\dynmap\tiles

OR

  • Create virtual folder inside iis by right clicking on dynmap folder Add Virtual Directory nameed tiles (alias) and Physical path that points to dynmap plugin folder/web/tiles

Now the rewrite part:

  • Select dynmap folder in IIS and click URL Rewrite icon, then Add rule(s); select Reverse proxy. In inbound rule enter 127.0.0.1:8123 and click ok. When asked if enable reverse proxy select Yes.
  • Browse to your dynmap web folder (C:\Inetpub\wwwroot\dynmap\) and open web.config with notepad and adjust content to:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <clear />
                <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="up/(.*)" />
                    <action type="Rewrite" url="http://127.0.0.1:8123/up/{R:1}" />
                </rule>
				<rule name="ReverseProxyInboundRule2" stopProcessing="true">
                    <match url="standalone/(.*)" />
                    <action type="Rewrite" url="http://127.0.0.1:8123/standalone/{R:1}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Also, some version of IIS (7.x in any case) will not automatically assign the proper MIME type for the *.json files that can be needed by dynmap (resulting in a 406 or 404 error when attempting to load these files, such as those used by the Markers API). To address this, follow the procedure here - http://support.microsoft.com/kb/942050 - to define the MIME type 'application/json' to the 'json' file extension.

Also, for more details on how to get IIS6 and IIS7 handing JSON properly, see http://www.sencha.com/forum/showthread.php?33266-Some-Problem-with-JSON&p=229858&viewfull=1#post229858