Author |
|
Phippsy2900
Joined: 17 Mar 2015 Posts: 5 Location: United Kingdom, Bristol
|
Posted: Wed 18 Mar '15 13:07 Post subject: Apache 2.4 SAP Fiori Custom CSS not rewritten |
|
|
I've been asked to put an Apache Reverse Proxy in place as per guidance from SAP - http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60e0537a-a1a4-3210-758e-9449c61e23a3?QuickLink=index&overridelayout=true&59983513260662 - but have come across an issue where the CSS file is not rewritten by the reverse proxy. The below is the Virtual Hosts entry from the test httpd.conf that i'm running to get it working. I'll be moving this to vhosts entries when it eventually works (optimism slowly vanishing! ).
Listen 443
<VirtualHost *:443>
SSLEngine On
SSLProxyEngine On
ProxyRequests Off
ProxyPreserveHost On
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
AllowEncodedSlashes On
SSLCertificateFile /Apache24/conf/FILE.crt
SSLCertificateKeyFile /Apache24/conf/KEYFILE.key
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
ServerName Gateway.External.co.uk
ProxyPass / http://SAPGateway.Internal:8010/ nocanon
ProxyPassReverse / http://SAPGateway.Internal:8010/
ErrorLog "C:/Apache24/logs/error.log"
TransferLog "C:/Apache24/logs/access.log"
</VirtualHost>
Each post I come across with a similar issue mentions the trailing '/' on the ProxyPass entries, unfortunately - for me - they're there!
I'm new to Apache, but willing to learn so any help would be very gratefully received.
Kind Regards |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Wed 18 Mar '15 14:30 Post subject: |
|
|
Did you use a tool like firebug or so to see which URL is requested for the CSS file? |
|
Back to top |
|
Phippsy2900
Joined: 17 Mar 2015 Posts: 5 Location: United Kingdom, Bristol
|
Posted: Wed 18 Mar '15 14:52 Post subject: |
|
|
I've used Fiddler and get a 502 for the Get Request of this css page. The WebView shows that there's a DNS lookup failure because it's pointing to the internal server name and not the reverse address.
From the client machine, if I take the CSS path and append it to the external address I can load the CSS - as a file - without issue. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Wed 18 Mar '15 15:13 Post subject: |
|
|
Ah, ok! So you need to use mod_proxy_html or mod_sed to change the domain name. |
|
Back to top |
|
Phippsy2900
Joined: 17 Mar 2015 Posts: 5 Location: United Kingdom, Bristol
|
Posted: Wed 18 Mar '15 15:20 Post subject: |
|
|
Mod_Proxy_HTML and Mod_Sed are enabled, would this need an expression to capture the URL?
Is there something I can read to work this out, i'm not a fan of regular expressions! |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
|
Back to top |
|
Phippsy2900
Joined: 17 Mar 2015 Posts: 5 Location: United Kingdom, Bristol
|
Posted: Wed 18 Mar '15 15:37 Post subject: |
|
|
So.
AddOutputFilter Sed html
OutputSed "s/InternalAddress/ExternalAddres/g"
It can't be that simple...can it?
Edited to add:
External address is https, internal is http. |
|
Back to top |
|
Phippsy2900
Joined: 17 Mar 2015 Posts: 5 Location: United Kingdom, Bristol
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Wed 18 Mar '15 18:05 Post subject: |
|
|
O_o what is ... not so good
with mod_proxy_html
Code: |
ProxyHTMLEnable On
ProxyHTMLURLMap http://InternalServer.Domain.com:8888 https://ExternalServer.Domain.com
|
|
|
Back to top |
|