# Xojo webapp Vs. IIS/app with domain certificate

**URL:** <https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684>\
**Category:** Web\
**Created:** [September 7, 2024, 10:52am UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684 "2024-09-07T10:52:17Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![oscar\_morotti](https://forum.xojo.com/letter_avatar_proxy/v4/letter/o/a4c791/32.png) [@oscar\_morotti](https://forum.xojo.com/u/oscar_morotti)\
**Post date:** [September 7, 2024, 10:52am UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/1 "2024-09-07T10:52:17Z")

</div>

Hi to all,

this is my situation: VPS with windows server 2022, IIS, domain  
name and certificate for https. All work properly, I can see [https://www.mydomain.com](https://www.mydomain.com) and I create a little app with [asp.NET](http://asp.NET), I configure it like an app under IIS default website and I can see it by [https://www.mydomain.com/asptest](https://www.mydomain.com/asptest).

Now I try to configure some Xojo Webapps with IIS default website like an app, so I can use the url [https://www.mydomain.com/appname1](https://www.mydomain.com/appname1) for first app, [https://www.mydomain.com/appname2](https://www.mydomain.com/appname2) for second and so on.

I’m not a specialist about IIS.

I read documentation about how to use IIS (for example [Windows IIS Deployment](https://forum.xojo.com/t/windows-iis-deployment/72178)).

I create a windows service and now I can see my app by [http://www.mydomain.com](http://www.mydomain.com):port.

After I create an app in IIS Manager with name and physical path to the folder with all files about my Xojo app, I create a URL Write, and all seams to be ok.

When I try to open [https://www.mydomain.com/appname1](https://www.mydomain.com/appname1) I see a blank page, if I look inside browser development tools I see a message about missing css resources.

Can someone help me by suggesting what I need to check? Is it a problem about missing resources or other things about IIS configuration?

Thank you,

Oscar  
 ![000](https://forum.xojo.com/uploads/default/original/3X/e/4/e4dab7d16a83c51b7b268e778407d953614914f0.png)  
 ![001](https://forum.xojo.com/uploads/default/original/3X/8/1/81ba84a69d55ee83ed26e4a8bda7748e614e35b0.png)  
 ![002](https://forum.xojo.com/uploads/default/original/3X/1/9/19d4b5689d6329c7560fce9b4e755755f4fb2d54.png)  
 ![003](https://forum.xojo.com/uploads/default/original/3X/9/9/99702eeee6fbf099e7a6084e2364aff42fb5a217.png)

 ![004](https://forum.xojo.com/uploads/default/original/3X/3/3/331c8a8e1a312f6728210ee5e8242a7603214e36.png)  
 ![005](https://forum.xojo.com/uploads/default/original/3X/9/f/9f5b0a990e933707678cc417343fcc335e2f102e.png)

---

<div class="post-metadata">

**Author:** ![Greg\_O](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o/32/22785_2.png) [@Greg\_O](https://forum.xojo.com/u/Greg_O)\
**Post date:** [September 7, 2024, 1:16pm UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/2 "2024-09-07T13:16:56Z")

</div>

In the reverse proxy settings, you also need outbound rules to convert the local host address back into a domain name

---

<div class="post-metadata">

**Author:** ![Greg\_O](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o/32/22785_2.png) [@Greg\_O](https://forum.xojo.com/u/Greg_O)\
**Post date:** [September 7, 2024, 3:32pm UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/3 "2024-09-07T15:32:59Z")

</div>

Scratch that. IIS doesn’t support rewriting when the content is compressed with gzip compression. I was able to get this working however…

For anyone that stumbles on this, there’s a few pieces you’ll need to install:

1. Install IIS (seems obvious, but it’s not enabled by default on non-server versions of Windows)
2. Download and install the [IIS URL Rewrite Module](https://www.iis.net/downloads/microsoft/url-rewrite) from the Microsoft website.
3. Download and install the [Application Request Routing (ARR) module](https://www.iis.net/downloads/microsoft/application-request-routing) from the Microsoft website.
4. Open **IIS Manager** and go to the Server Level by clicking on the server name.
5. Double-click the **Application Request Routing Management** item.
6. On the right-hand side, click **Server Proxy Settings**.
7. Check the **Enable Proxy** checkbox.
8. Select your website in the left-hand panel.
9. Double-click **URL Rewrite**.
10. On the right side, click **Add Rule(s)**.
11. Choose **Blank Rule** under **Inbound Rules** and click **OK**.
12. Configure the rule:
  1. Match URL:
    1. Requested URL: **Matches the Pattern**
    2. Using: **Regular Expressions**
    3. Pattern = `(.*)`
    4. Ignore case: checked

  2. Action
    1. Action Type: **Rewrite**
    2. Rewrite URL: `http://127.0.0.1:8080/{R:1}`
    3. Append query string: **checked**
    4. Stop processing of subsequent rules: **checked**

13. Click the **Apply** button on the right-hand side
14. Click the **Back to Rules** button on the right-hand side
15. Select your website on the left-hand panel again.
16. Click the **Restart** button in the right-hand panel **VERY IMPORTANT**

The Rewrite URL in step 12.2.2 should match the port number that your Xojo app is running on. I used 8080 because that was what I set in my Xojo project.

---

<div class="post-metadata">

**Author:** ![oscar\_morotti](https://forum.xojo.com/letter_avatar_proxy/v4/letter/o/a4c791/32.png) [@oscar\_morotti](https://forum.xojo.com/u/oscar_morotti)\
**Post date:** [September 7, 2024, 3:50pm UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/4 "2024-09-07T15:50:32Z")

</div>

Hi Greg,

thanks for your reply.  
I followed your instructions step by step, something has changed but unfortunately it still doesn’t work. Now the page shown by the browser is no longer blank but an error 500 appears.

Can I check other?

Thank you,

Oscar

 ![006](https://forum.xojo.com/uploads/default/original/3X/0/7/0795a78d88c4165e13739e4951ef38d50152efd2.png)  
 ![007](https://forum.xojo.com/uploads/default/original/3X/e/8/e820dba8575f968f45ee9c9c85eb5a3d97d384f2.png)

---

<div class="post-metadata">

**Author:** ![Greg\_O](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o/32/22785_2.png) [@Greg\_O](https://forum.xojo.com/u/Greg_O)\
**Post date:** [September 7, 2024, 4:13pm UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/5 "2024-09-07T16:13:55Z")

</div>

> [@oscar\_morotti](#):
>
> but an error 500 appears.

What does the error say on the browser window? Not the developer tools

---

<div class="post-metadata">

**Author:** ![Greg\_O](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o/32/22785_2.png) [@Greg\_O](https://forum.xojo.com/u/Greg_O)\
**Post date:** [September 7, 2024, 4:15pm UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/6 "2024-09-07T16:15:42Z")

</div>

Remove the outbound rule.

---

<div class="post-metadata">

**Author:** ![oscar\_morotti](https://forum.xojo.com/letter_avatar_proxy/v4/letter/o/a4c791/32.png) [@oscar\_morotti](https://forum.xojo.com/u/oscar_morotti)\
**Post date:** [September 7, 2024, 4:58pm UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/7 "2024-09-07T16:58:29Z")

</div>

Hi Greg,  
with inbound and outbound rules with firefox I have error 500, with chrome after some minute with circle wait icon appear error 503.  
Now I remove the outbound rules and I update you.  
Thank you,  
Oscar

PS I see always my app if I open [http://www.mydomain.com/myapp](http://www.mydomain.com/myapp)

 ![Schermata 2024-09-07 alle 18.54.27](https://forum.xojo.com/uploads/default/original/3X/5/1/51763d0b70e735fa556cdc9e27c535dc761dbcbd.png)  
 ![Schermata 2024-09-07 alle 18.55.44](https://forum.xojo.com/uploads/default/original/3X/a/e/ae787a3ffc7758aa7bd45dc510072c9b952c6ace.png)

---

<div class="post-metadata">

**Author:** ![oscar\_morotti](https://forum.xojo.com/letter_avatar_proxy/v4/letter/o/a4c791/32.png) [@oscar\_morotti](https://forum.xojo.com/u/oscar_morotti)\
**Post date:** [September 7, 2024, 5:03pm UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/8 "2024-09-07T17:03:12Z")

</div>

Hi Greg,  
by removing outbound rules I have the previous situation, the browser show a blank page. In the URL bar I can see my valid certificate, but nothing else.

Thank you,  
Oscar

---

<div class="post-metadata">

**Author:** ![Greg\_O](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o/32/22785_2.png) [@Greg\_O](https://forum.xojo.com/u/Greg_O)\
**Post date:** [September 7, 2024, 6:41pm UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/9 "2024-09-07T18:41:45Z")

</div>

Can you show a screenshot of the incoming rule?

---

<div class="post-metadata">

**Author:** ![Greg\_O](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o/32/22785_2.png) [@Greg\_O](https://forum.xojo.com/u/Greg_O)\
**Post date:** [September 7, 2024, 8:15pm UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/10 "2024-09-07T20:15:29Z")

</div>

Ok, so I did a little work here with a self-signed certificate (since I don’t have a real cert to try at the moment)

Here are screenshots of IIS, SSL Settings and the one Inbound Rule I’m using, as well as screenshots of Edge and Firefox showing the app running…

 ![image](https://forum.xojo.com/uploads/default/original/3X/1/5/1566a2ea5adc98ba8352db1fdc7402d4f0461fdb.jpeg)

NOTE: I set up local DNS and was able to get it working with an actual domain using these settings as well…

 ![image](https://forum.xojo.com/uploads/default/original/3X/a/c/acdd3bb74651abcec134a71b2d9add43e53bade6.png)

---

<div class="post-metadata">

**Author:** ![oscar\_morotti](https://forum.xojo.com/letter_avatar_proxy/v4/letter/o/a4c791/32.png) [@oscar\_morotti](https://forum.xojo.com/u/oscar_morotti)\
**Post date:** [September 8, 2024, 7:24am UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/11 "2024-09-08T07:24:17Z")

</div>

Hi Greg,  
I think all settings are the same but I can’t see Xojo application webpage.  
Here the screenshot.  
Thank you,  
Oscar

 ![xojo-iis](https://forum.xojo.com/uploads/default/original/3X/6/d/6d186cf462e5f8da05e91704ee7206e96ffb0c0e.jpeg)

---

<div class="post-metadata">

**Author:** ![Greg\_O](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o/32/22785_2.png) [@Greg\_O](https://forum.xojo.com/u/Greg_O)\
**Post date:** [September 8, 2024, 12:34pm UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/12 "2024-09-08T12:34:58Z")

</div>

Try it without the dawesa subfolder and see if _that_ works. Then we can work from there.

---

<div class="post-metadata">

**Author:** ![Greg\_O](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o/32/22785_2.png) [@Greg\_O](https://forum.xojo.com/u/Greg_O)\
**Post date:** [September 8, 2024, 4:07pm UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/13 "2024-09-08T16:07:24Z")

</div>

Ya know, the fact that if you change the action on that rule to a redirect and it just works makes this feel like a bug in IIS. Everything I’m reading says this _should_ work the way we’re putting it in, but in redirect mode, it serves up the files in the target directory instead of following the rule.

---

<div class="post-metadata">

**Author:** ![Greg\_O](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o/32/22785_2.png) [@Greg\_O](https://forum.xojo.com/u/Greg_O)\
**Post date:** [September 8, 2024, 8:24pm UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/14 "2024-09-08T20:24:14Z")

</div>

Ok, so it looks like this inability to serve apps this way is actually a Xojo issue. I’m not going to call it a “bug” per se, but it looks like what the web framework is doing is tacking whatever is in `App.URL + "/"` in front of all of the initial resources when a session first starts up. If instead they only did that when App.URL is not empty, this would work a lot better.

At the very least, if there were a way to specify that the app was running behind a proxy and that the “/” shouldn’t be added, that would at least get you where you need to be.

@Ricardo_Cruz

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [September 8, 2024, 9:53pm UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/15 "2024-09-08T21:53:52Z")

</div>

I believe there’s a launch parameter you’re supposed to use when the Xojo Web app resides at a non-root URL. I thought it was added specifically to support `apps.at/subpaths/`.

Is this related at all? I’m fuzzy on specifics because I never needed the subpathed app urls.

---

<div class="post-metadata">

**Author:** ![Greg\_O](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o/32/22785_2.png) [@Greg\_O](https://forum.xojo.com/u/Greg_O)\
**Post date:** [September 9, 2024, 1:09am UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/16 "2024-09-09T01:09:11Z")

</div>

> [@Tim\_Parnell](#):
>
> I believe there’s a launch parameter you’re supposed to use when the Xojo Web app resides at a non-root URL

I’d be delighted if that were the case, but I can’t find any docs that describe such a parameter.

FWIW - ChatGPT thinks it’s  
`--baseurl=/subdirectory`

---

<div class="post-metadata">

**Author:** ![Anthony\_G\_Cyphers](https://forum.xojo.com/user_avatar/forum.xojo.com/anthony_g_cyphers/32/16862_2.png) [@Anthony\_G\_Cyphers](https://forum.xojo.com/u/Anthony_G_Cyphers)\
**Post date:** [September 9, 2024, 1:21am UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/17 "2024-09-09T01:21:12Z")

</div>

![image](https://forum.xojo.com/uploads/default/original/3X/9/9/99f8c94fe3028f7d979bfd4cf5c80982e26b5b14.png)

[https://documentation.xojo.com/topics/application\_deployment/web/deployment\_details.html](https://documentation.xojo.com/topics/application_deployment/web/deployment_details.html)

---

<div class="post-metadata">

**Author:** ![Greg\_O](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o/32/22785_2.png) [@Greg\_O](https://forum.xojo.com/u/Greg_O)\
**Post date:** [September 9, 2024, 1:42am UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/18 "2024-09-09T01:42:26Z")

</div>

> [@Anthony\_G\_Cyphers](#):
>
> [Deployment details — Xojo documentation](https://documentation.xojo.com/topics/application_deployment/web/deployment_details.html)

Interesting… I looked here:

[https://documentation.xojo.com/api/web/webapplication.html#description](https://documentation.xojo.com/api/web/webapplication.html#description)

all the way at the bottom, there’s a chart of command-line parameters, and BaseURL is not among them.

---

<div class="post-metadata">

**Author:** ![Greg\_O](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o/32/22785_2.png) [@Greg\_O](https://forum.xojo.com/u/Greg_O)\
**Post date:** [September 9, 2024, 2:05am UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/19 "2024-09-09T02:05:17Z")

</div>

Ok, so that works. To sum up:

When you launch your service, add a command-line parameter like this:

```auto
c:\inetpub\yourapp\yourapp.exe --baseurl=/subdirectory

```

In IIS, you should right-click on your site and create an application with a virtual path of `subdirectory`. I suggest that the physical directory be empty or just contain a blank index.html file so end-users can’t inadvertently access your app’s contents if the app goes down or IIS is misconfigured.

You should add a URL Rewrite rule configured like this:

| | |
| --- | --- |
| Requested URL: | Matches the Pattern |
| Using: | Regular Expressions |
| Pattern | `(.*)` |
| Ignore Case | Checked |
| Conditions | None |
| Server Variables | None |
| Action Type | Rewrite |
| Rewrite URL | `http://127.0.0.1:8080/{R:1}` |
| Append query string | Checked |
| Stop Processing of subsequent rules | Checked |

It may also be worth creating your own set of Error Pages for your app as the one for 502.3 - Bad Gateway exposes a lot of information that you might not want a user to know.

---

<div class="post-metadata">

**Author:** ![oscar\_morotti](https://forum.xojo.com/letter_avatar_proxy/v4/letter/o/a4c791/32.png) [@oscar\_morotti](https://forum.xojo.com/u/oscar_morotti)\
**Post date:** [September 9, 2024, 5:27am UTC](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684/20 "2024-09-09T05:27:20Z")

</div>

Hi Greg and all other,  
I make the configuration, now all work perfectly!  
Thanks so much for the help,  
Oscar

[Next page](https://forum.xojo.com/t/xojo-webapp-vs-iis-app-with-domain-certificate/81684.md?page=2)
