I am using Apache for the first time and came across a below requirement.
I am having a requirement to implement a ReverseProxy in Apache based on the HTTP:Accept-Language, my application is hosting enu and french language.
As the URL doesn't have the enu/fra string in it and it can be determined based on the HTTP locale information sent by the authentication system.
Please let us know how we can use the conditional ReverseProxy, as the user will not see any change in the URL he is accessing only the application content will vary based on the language.
I have performed the reverse proxy without language filter successfully however would like to know how can we do it using language.
<IfModule mod_proxy.c>
SSLProxyEngine on
ProxyPreserveHost On
ProxyRequests off
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
ProxyPass / https://mydomain:9011/ timeout=1800 Keepalive=On
ProxyPassReverse / https://mydomain:9011/
</IfModule>
Thanks for your input in advance.
P(for proxy) target to create rewrite rules that provide a similar reverse proxy functionality that the more staticProxyPassdirectives provide. That should allow you to make a conditional reverse proxy https://httpd.apache.org/docs/2.4/rewrite/proxy.html – HBruijn Mar 26 '19 at 10:40My webserver is listening to 443 with hostname : sdncogoeri123 If the application language is selected as English/French then we are looking to redirect the same by routing the request to mydomain:9011 (webserver:port):
End user should see the URL as https://sdncogoeri123/oracle/app/ebs/enu if language was English End user should see the URL as https://sdncogoeri123/oracle/app/ebs/fra if language was French
– Amit Mar 26 '19 at 21:34RewriteEngine On RewriteCond %{Accept-Language} ^fr [NC] RewriteRule ^/oracle$ https://mydomain:9011/oracle/app/ebs/fra [P] ProxyPassReverse "/oracle/app/ebs/" "https://mydomain:9011/oracle/app/ebs/fra"
RewriteCond %{Accept-Language} ^en [NC] RewriteRule ^/oracle$ https://mydomain:9011/oracle/app/ebs/enu [P] ProxyPassReverse "/oracle/app/ebs/" "https://mydomain:9011/oracle/app/ebs/enu"
– Amit Mar 26 '19 at 21:34