Skip to content

Instantly share code, notes, and snippets.

@tracker1
Last active May 11, 2019 14:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tracker1/90970a456ce13c48339f92decb57046d to your computer and use it in GitHub Desktop.
Save tracker1/90970a456ce13c48339f92decb57046d to your computer and use it in GitHub Desktop.
Web.config file for synchronet on IIS

You'll need windows server, or windows pro for this, so that you have IIS. I'm running Windows 10 Pro.

Move your BBS's Web settings to bind on port 8000 (or any internal port you choose).

Install Application Request Routing (ARR)

Add your BBS's web/root directory to a new website in IIS, you must specify a host name, you can add additional host names under bindings.

My web.config file below, this file should also go into your web/root. You'll need to replace localhost:8000 with the appropriate port you are using. You sould also replace the www\.roughneckbbs\.com and www.roughneckbbs.com references with your host name.

Download and extract letsencrypt-win-simple, and run letsencrypt from an administrator command prompt.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<!-- Use the preferred hostname, redirect raw to www. -->
<rule name="CanonicalHostNameRule1">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www\.roughneckbbs\.com$" negate="true" />
</conditions>
<action type="Redirect" url="https://www.roughneckbbs.com/{R:1}" />
</rule>
<!-- Force https -->
<rule name="Force HTTPS" enabled="true">
<match url="(.*)" ignoreCase="false" />
<conditions>
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="true" redirectType="Permanent" />
</rule>
<!-- reverse-proxy anything that isn't a file on the filesystem -->
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="http://localhost:8000/{R:1}" logRewrittenUrl="true" />
</rule>
<!-- reverse proxy *.ssjs files - use synchronet -->
<rule name="ReverseProxyInboundRule2" stopProcessing="true">
<match url="(.+\.ssjs(\?.*)?)" />
<action type="Rewrite" url="http://localhost:8000/{R:1}" logRewrittenUrl="true" />
</rule>
<!-- reverse proxy *.xjs files - use synchronet -->
<rule name="ReverseProxyInboundRule3" stopProcessing="true">
<match url="(.+\.xjs(\?.*)?)" />
<action type="Rewrite" url="http://localhost:8000/{R:1}" logRewrittenUrl="true" />
</rule>
</rules>
</rewrite>
<defaultDocument>
<files>
<!-- Make sure index.xjs and index.ssjs are used as "default" files for directories -->
<add value="index.xjs" />
<add value="index.ssjs" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment