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 and I create a little app with asp.NET, I configure it like an app under IIS default website and I can see it by https://www.mydomain.com/asptest.
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 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?
Open IIS Manager and go to the Server Level by clicking on the server name.
Double-click the Application Request Routing Management item.
On the right-hand side, click Server Proxy Settings.
Check the Enable Proxy checkbox.
Select your website in the left-hand panel.
Double-click URL Rewrite.
On the right side, click Add Rule(s).
Choose Blank Rule under Inbound Rules and click OK.
Configure the rule:
Match URL:
Requested URL: Matches the Pattern
Using: Regular Expressions
Pattern = (.*)
Ignore case: checked
Action
Action Type: Rewrite
Rewrite URL: http://127.0.0.1:8080/{R:1}
Append query string: checked
Stop processing of subsequent rules: checked
Click the Apply button on the right-hand side
Click the Back to Rules button on the right-hand side
Select your website on the left-hand panel again.
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.
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.
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
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.
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.
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.
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.
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.