* "http://i.server.com";; will open the general landing page.
* "http://i.server.com/TheCoop";; will open landing page /TheCoopHome to
display all 6 services.
* "http://i.server.com/TheCoop/F2C/90";; will directly return 32.44 degrees.

This is almost exactly what you need, except you should map your web service to its own "root" path on the web server in order to make it easier to make the reverse proxy mapping.

So, instead of "http://i.server.com/TheCoop/F2C/90";, I would chose a URI that started something like this "/TheCoop/api", giving you URIs like this, for example, "http://i.server.com/TheCoop/api/F2C/90";. This way you can set-up your web server to reverse proxy all URIs starting "/TheCoop/api" to "http://i.server.com:10000/web/services";. If your web pages and web service all have the same root path it's difficult, if not impossible to set-up the reverse proxying because you cannot identify which is which, whereas here we're saying 'anything that starts "/TheCoop/api" we know has to be forwarded to the web service'.

So, as described in my previous (unbelievably typo free 😊 ) mail, set-up a reverse proxy mapping like this in the IBM i HTTP server:

"Client requests" "/TheCoop/api" "http://localhost:10000/TheCoop";

This should give you:

* "http://i.server.com";; will open the general landing page.
* "http://i.server.com/TheCoop";; will open landing page /TheCoopHome to display all 6 services.
* "http://i.server.com/TheCoop/api/F2C/90";; will directly return 32.44 degrees. <-- this is being proxied to the web service at port 10000!!

Obviously you will need to adjust your AJAX URIs to have the "/TheCoop/api" bit in them.

Finally, I would recommend not using mixed case URIs because sometimes it makes a difference and sometimes not (see another thread about this). I would prefer lower "kebab-case" URIs, so "http://i.server.com/the-coop";.

Tim.










________________________________
From: WEB400 <web400-bounces@xxxxxxxxxxxx> on behalf of Booth Martin <booth@xxxxxxxxxxxx>
Sent: 11 December 2018 00:18
To: Web Enabling the IBM i (AS/400 and iSeries)
Subject: Re: [WEB400] Header set Access-Control-Allow-Origin for web services

This is not going well.

The scenario is:

* "https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fi.server.com%3A10000%2Fweb%2Fservices%2FF2C%2F90&amp;data=02%7C01%7C%7C766b9c739a954f5c183c08d65ef5de38%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636800807413383076&amp;sdata=fm1pOG6P5Qtao8qEPIENBfbNf5zChv1nhZRcR%2BBeFm8%3D&amp;reserved=0"; from any browser
that is inside the VPN returns 90 degrees F converted to 32.44 degrees C
* "https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fi.server.com&amp;data=02%7C01%7C%7C766b9c739a954f5c183c08d65ef5de38%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636800807413383076&amp;sdata=649VzMkWQ7RJEVnX4FI4RB004nCEiLByOzC18QhggCg%3D&amp;reserved=0"; (port 80) opens a general web landing page
which includes a link that opens another landing page(TheCoopHome)
devoted to the 6 different services running on port 10000.
* The Web services server and the associated HTTP server, created with
the IWS wizard, is named TheCoop.

My goal is that

* "https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fi.server.com&amp;data=02%7C01%7C%7C766b9c739a954f5c183c08d65ef5de38%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636800807413383076&amp;sdata=649VzMkWQ7RJEVnX4FI4RB004nCEiLByOzC18QhggCg%3D&amp;reserved=0"; will open the general landing page.
* "https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fi.server.com%2FTheCoop&amp;data=02%7C01%7C%7C766b9c739a954f5c183c08d65ef5de38%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636800807413383076&amp;sdata=hx%2Bu0TPGf8x3q%2FY5G9lETYUuMfWzEVkT1IIVBwX0pgw%3D&amp;reserved=0"; will open landing page /TheCoopHome to
display all 6 services.
* "https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fi.server.com%2FTheCoop%2FF2C%2F90&amp;data=02%7C01%7C%7C766b9c739a954f5c183c08d65ef5de38%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636800807413383076&amp;sdata=Wjhu0%2BLQFd2GBlNfKSuY4QgRyyATKtS%2FXtGKYN%2BhlGM%3D&amp;reserved=0"; will directly return 32.44 degrees.


On 12/6/2018 3:34 PM, Tim Fathers wrote:
https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fi.server.com%3A10000%2Fweb%2Fservices%2FOceans&amp;data=02%7C01%7C%7C766b9c739a954f5c183c08d65ef5de38%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636800807413383076&amp;sdata=q8s38NytcVVl%2FZDubJIS7rW9mYjgrQ333IBAEhFmGJw%3D&amp;reserved=0 which is your experimental web service
https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fi.server.com%3A80%2F&amp;data=02%7C01%7C%7C766b9c739a954f5c183c08d65ef5de38%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636800807413383076&amp;sdata=vYdP5RyifjViT%2FAGGFu%2BSF8eyjr7blqeKxTfF%2FEsluE%3D&amp;reserved=0 which is your web server serving up your HTML/Javascript pages (I've assumed port 80)
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.midrange.com%2Fmailman%2Flistinfo%2Fweb400&amp;data=02%7C01%7C%7C766b9c739a954f5c183c08d65ef5de38%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636800807413383076&amp;sdata=lFCVIP%2BZJC9xZyAx9FU%2BMvfjFudjKAQ8WDQX4GyvcA8%3D&amp;reserved=0
or email: WEB400-request@xxxxxxxxxxxx
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&amp;data=02%7C01%7C%7C766b9c739a954f5c183c08d65ef5de38%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636800807413383076&amp;sdata=O6a%2FT0LzvI2hdz7VDmjnGiSb1XZIFjgUDBkOFAP4RQs%3D&amp;reserved=0.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.