Reverse Proxy directory override?

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
bruceanthony
Profound User
Posts: 52
Joined: Mon Sep 19, 2011 3:00 pm
First Name: Bruce
Last Name: Anthony
Company Name: The State Bar of California
Contact:

Reverse Proxy directory override?

Post by bruceanthony »

Reverse Proxy:

We have been successfully using an IIS reverse proxy to our IBM ProfoundUI applications.

https://URL and http://ibmI_name:8100/profoundui/start?pgm=.......

Our web master would like to change this so that the reverse proxy application no longer is at the root but within a specific directory.

https://URL would become https://URL/dirName

This change is not working for us. We believe that if we change the following code of /profoundui to be simply profoundui that it will work.

The following code appears just after our start.html and it appears to come from a program within profound library on the IBMI:

Is there any way to easily remove the slash in front of profoundui?

</html><!-- Start of Custom Tags -->
<link rel="stylesheet" type="text/css" href="/profoundui/userdata/custom/css/sb.css?mtime=20121030150922" >
<link rel="stylesheet" type="text/css" href="/profoundui/userdata/custom/css/sb_print.css?mtime=20121204150910" >
<script type="text/javascript" src="/profoundui/userdata/custom/js/custom_sb_web.js?mtime=20160825113746"></script>
<script type="text/javascript" src="/profoundui/userdata/custom/js/settings.js?mtime=20160517141604"></script>
<script type="text/javascript" src="/profoundui/userdata/custom/widgets/googlemaps.js?mtime=20140319100131"></script>
<script type="text/javascript" src="/profoundui/userdata/custom/widgets/listbox.js?mtime=20101112144620"></script>
<script type="text/javascript" src="/profoundui/userdata/custom/widgets/panel.js?mtime=20120103100117"></script>
<script type="text/javascript" src="/profoundui/userdata/custom/widgets/styled_button.js?mtime=20101112144612"></script>
<script type="text/javascript" src="/profoundui/userdata/custom/widgets/tabpanel.js?mtime=20120103163646"></script>
<!-- End of Custom Tags -->
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Reverse Proxy directory override?

Post by Scott Klement »

There is a program in Profound UI that will read all of the files in all subdirectories beneath "userdata/custom", and create <script> and <link> tags for any JS or CSS files. There is no way to change that program to use relative links, as you describe.

However, you don't need to use that program at all.

You'll find this line in your Apache config:

Code: Select all

ScriptAlias /profoundui/start /QSYS.LIB/PROFOUNDUI.LIB/PUI0005001.PGM
You could potentially change that to this:

Code: Select all

Alias /profoundui/start /www/profoundui/htdocs/profoundui/userdata/html/mycustomstart.html
Now it no longer runs the program that automatically generates the link and script tags, but instead, just reads the mycustomstart.html file directly. You can then copy "start.html" to "mycustomstart.html" and edit the resulting file, adding in the additional script and link tags yourself rather than having them generated by our software. This will allow you to code them however you wish.

The only disadvantage to this approach is that you will have to manually add additional link/script tags when you add additional custom files. But, this doesn't usually happen that often, so it's not a big deal, and lets you code the links however you want, which would be important in your scenario.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Reverse Proxy directory override?

Post by Scott Klement »

I should add one more tidbit to this... if you make the change, above, you lose two things that this program does for you:

1) The program automatically generates the <link> and <script> tags described above, so these must be added manually, as noted above.

2) The programs also adds timestamps to the filenames, so that in the event that one is modified (such as when you upgrade Profound UI) it will have a new timestamp and therefore the changes will be immediately propagated to the browser.

So doing this yourself with a custom start.html might be a good solution for you, but when changes are made you'll have to either clear the browser's cache, or wait for the cached copies to expire. This isn't usually too big of a deal, but can be confusing if you're not expecting it.
bruceanthony
Profound User
Posts: 52
Joined: Mon Sep 19, 2011 3:00 pm
First Name: Bruce
Last Name: Anthony
Company Name: The State Bar of California
Contact:

Re: Reverse Proxy directory override?

Post by bruceanthony »

I tried but it doesn't work for me.
It almost appears that the PUI0005001.PGM in the following ScriptAlias is required:
ScriptAlias /profoundui/start /QSYS.LIB/GENIEAW.LIB/PUI0005001.PGM

My guess is that PUI0005001.PGM is reading the START.HTML in www/genieaw/htdocs/profoundui/userdata/html/start.html
and writing it out followed by additional javascript source etc.

Can I just write my own program and use it instead of PUI0005001.PGM? Am I correct that PUI0005001.PGM just generates the HTML?

I can hopefully return to this issue in a week or two. I should also tell you that I am using version 5.3.2 but this should hopefully not make a difference regarding this discussion.

Thank you.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Reverse Proxy directory override?

Post by Scott Klement »

As mentioned before, that program provides timestamps on the files so that the browser cache automatically reloads when the file changes, and it adds script/link tags for the files under userdata/custom. But.. that's really all it does...

You shouldn't need to run that program. We have several customers that run the software by starting directly with http://XXX/profoundui/userdata/html/XXX.html directly.

We also provide a shortcut alias to start.html in the product. What happens if you access http://[YOURSERVER:PORT]/profoundui/start.html? Does that work for you?

With regards to the version -- it should not affect this discussion. However, this could be a problem for you with other things, as this version is so old that we cannot provide fixes for it, troubleshoot problems on it, etc. So if you ran into any problems with it, you'd really have to upgrade before we could support you. We strongly recommend that customers try to keep their versions as up to date as possible.
bruceanthony
Profound User
Posts: 52
Joined: Mon Sep 19, 2011 3:00 pm
First Name: Bruce
Last Name: Anthony
Company Name: The State Bar of California
Contact:

Re: Reverse Proxy directory override?

Post by bruceanthony »

Scott,
http://XXX/profoundui/userdata/html/XXX.html
Above works and is exactly what we needed. Thank you.
You are absolutely spot on when it comes to keeping up with the latest version. Trouble is management wants to eliminate the IBMi and will not hire any additional IBMi staff. I am loaded with work assignments and just can't seem to get around to upgrading to the latest version. I bet this story is not to knew to you. The IBMi is difficult to replace but management is determined.
Thanx again for your help.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest