Booth, try adding the following tag to your HTML.
<base href="/labs/">
I think the problem is that your app lives under "
http://the.i.ip/labs" however, all the relative URLs in your app are relative to the base URL, so "
http://the.i.ip" , in other words, your app is unaware that it lives, not at the root of your URL but under a subfolder of it called "labs". For example, if you have a script tag like this in your HTML:
<script type="text/javascript" src="myjavascript.js"></script>
...then the browser will attempt to retrieve the Javascript relative to the root of your URL here "
http://the.i.ip/myjavascript.js", when it should be actually trying to get it from"
http://the.i.ip/labs/myjavascript.js". The same for your CSS and images, and your links will all be relative to the wrong root too. By adding the <base> tag above you tell your app that it's root is actually not "
http://the.i.ip" but "
http://the.i.ip/labs" and then it knows to make any relative link in your page relative to "
http://the.i.ip/labs".
Tim.
________________________________
From: WEB400 <web400-bounces@xxxxxxxxxxxxxxxxxx> on behalf of Booth Martin <booth@xxxxxxxxxxxx>
Sent: 03 April 2019 19:23
To: Web Enabling the IBM i (AS/400 and iSeries)
Subject: [WEB400] Reverse proxy
I believe I am stating things accurately but will admit that this whole
area confuses me, and has, for some time.
* With the IWS Wizard I created an IWS application server, say "labs,"
at port 10011. The Wizard also created an http server at port 10021.
* I have a website folder in the IFS at www/labs/htdocs/ with .html,
.js, .json, and .css files.
* I have a reverse proxy added to the landing page at port 80 of
"/labs to
https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fthe.i.ip%3A10021&data=02%7C01%7C%7C284c54aab48e40d58f6908d6b859164f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636899090091715668&sdata=V9HqgoTBgucMJ3jVsOCog0pme6Ikp8vs1MvsqQXAX7A%3D&reserved=0"
* A browser request to _
https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fthe.i.ip%3A10011&data=02%7C01%7C%7C284c54aab48e40d58f6908d6b859164f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636899090091715668&sdata=qgLWMNfkm%2FZm4d1uVfmbZSyBdBJl680NfTMjw%2F5npVA%3D&reserved=0_ returns "Not Found."
* A browser request to _
https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fthe.i.ip%2Flabs_&data=02%7C01%7C%7C284c54aab48e40d58f6908d6b859164f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636899090091715668&sdata=7Z%2BjD5NE%2BPJaMI4gaLZ9A2ph4lBVaD7%2FFxhxd2o7xVM%3D&reserved=0 opens the correct
labs/index.html but has no styling, links don't connect, and
javascript files aren't active.
* A browser request to _
https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fthe.i.ip%3A10021&data=02%7C01%7C%7C284c54aab48e40d58f6908d6b859164f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636899090091715668&sdata=V9HqgoTBgucMJ3jVsOCog0pme6Ikp8vs1MvsqQXAX7A%3D&reserved=0_ opens the correct
labs/index.html and all files are accessed.
What has to happen to make _
https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fthe.i.ip%2Flabs_&data=02%7C01%7C%7C284c54aab48e40d58f6908d6b859164f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636899090091715668&sdata=7Z%2BjD5NE%2BPJaMI4gaLZ9A2ph4lBVaD7%2FFxhxd2o7xVM%3D&reserved=0 access the .css, .js
files, and the images folder?
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.midrange.com%2Fmailman%2Flistinfo%2Fweb400&data=02%7C01%7C%7C284c54aab48e40d58f6908d6b859164f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636899090091715668&sdata=nerD51cqLQLAXx78D93p2vp%2Bp87faeUQDX9BVVBU1SE%3D&reserved=0
or email: WEB400-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.midrange.com%2Fweb400&data=02%7C01%7C%7C284c54aab48e40d58f6908d6b859164f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636899090091725673&sdata=ffwC%2FgniliLJcfLiNfd1FeJYATxYXua8JCVRctmH%2Fyc%3D&reserved=0.
As an Amazon Associate we earn from qualifying purchases.