IIS Add Multiple Websites

In IIS I want to create multiple nested powershell sites under another site. I can create one site this way following the “Creating Nested IIS Sites” instructions here: https://docs.universaldashboard.io/webserver/running-dashboards/iis

The issue is you have to change the index.html file in the module to point to the path of one specific app. For example, I can add an app called “MyFirstApp” and change the index file to include “base href=”/MyFirstApp/"/" and this works. But if I wanted to add another app named “MySecondApp” I can’t do that unless I change the index.html file to “base href=”/MySecondApp/"/". But then MyFirstApp won’t work anymore. What’s the solution here?

I figured out a way to do this but it may not be the best way. I put a copy of the ‘universaldashboard.community’ module in my website’s folder that contains the web.config file. Then changed the index.html file. Then added this to the top of my dashboard.ps1 file

$PSModuleAutoloadingPreference=“None”
Import-Module ‘C:\WebSites\test\universaldashboard.community’

This will load the version of the ‘universaldshboard.community’ module that I saved to the website’s test folder instead of the module from my system32 folder.

The downside is every website would need a copy of the module which takes up memory.

@Aaron
you dont need to copy the module to each folder also you dont need to use import-module universaldashboard.community
first thing first you need to address the following
1- do you need to use nested site or individual sites?
nested will turn out this way
http://contoso.com/site1
http://contoso.com/site2
and so on which is similar to like pages.

2-individual sites will be


http://site1.com

this will require dns entry and some other configuration

either way if you install the module directly on the machine, then the web.config file will take care of launching powershell and initiate the dashboard file.
you just need to make sure that your web.config file is configured properly

I need to do nested sites since I don’t have access to add dns entries. The problem with that is that I have to change the index.html file in the module folder to the app’s url. For example, “base href=”/site1/"/". If you leave it as the default “base href=”/"/" this doesn’t work for nested sites. So since you only have one module folder, changing the index.html file applies to all apps using that module.

If you look at these instructions, it says you have to change the index.html file to get it to work for nested sites https://docs.universaldashboard.io/webserver/running-dashboards/iis.

@Aaron
This is correct if you are nesting multiple sites of UD, you have to have a module for each.