2

I have a URL www.example.com. This should point to the page

www.data.city.author/blah/blah/fjfjf/fkkeklf/eied/shudfj 

and show the content in

www.data.city.author/blah/blah/fjfjf/fkkeklf/eied/shudfj 

but in the address box, it should show www.example.com

My present configuration in vhost.conf for the proxy is:

SSLProxyEngine on

Proxypass "/" www.data.city.author/blah/blah/fjfjf/fkkeklf/eied/shudfj
ProxyPassReverse  "/" www.data.city.author/blah/blah/fjfjf/fkkeklf/eied/shudfj

The Problem is that Apache 2.4 has a bug that when using ProxyPass, URL should not be more than 96 characters. So it is truncating the URL to 96 characters and hence the configuration is returning with an error message.

Any other way to solve my case. I tried using apache RewriteRule with [P] flag but it does not work in my case.

EDIT

Below is my present configuration

<VirtualHost *:11080>
ServerAdmin webmaster@dummy-host.example.com
ServerName int.chicagomeningvax.org
ServerAlias www.int.chicagomeningvax.org
DocumentRoot "/app/web-vhosts"
ErrorLog "/app/apache-vhosts/logs/error_log"
CustomLog "/app/apache-vhosts/logs/access_log" combined env=!dontlog




RewriteEngine on
RewriteRule / https://data.cityofchicago.org/Health-Human-Services/Meningitis-Vaccine-Locations-Map-Visualization/n4bi-r8ij [R=302,P]


</VirtualHost>
pradeep
  • 21
  • 1
  • 3
  • FYI: this is not a redirection, it is a proxy (modified in your question). You say `RewriteRule` did not work. Why? Show the configuration you used. Because besides `ProxyPass` and `RewriteRule`, there is no way to do a proxy. I looked at the bug report, it is still not fixed, and the workaround is `RewriteRule`. – Nic3500 Oct 30 '18 at 21:24
  • RewriteEngine on RewriteRule / https://data.cityofchicago.org/Health-Human-Services/Meningitis-Vaccine-Locations-Map-Visualization/n4bi-r8ij/$1 [R=302,L,P] – pradeep Oct 31 '18 at 21:15
  • 1
    A very longstanding bug in Apache 2: https://bz.apache.org/bugzilla/show_bug.cgi?id=53218 – metatoaster Nov 13 '18 at 02:41

1 Answers1

0

If your url is too long please use Alias instead, it worked for me. In your mod_proxy.conf file:

Alias http://dummy:8009 http://yourlongoriginalurl:8009


Proxypass / http://dummy:8009
ciis0
  • 311
  • 1
  • 9
Noha
  • 59
  • 3
  • Directive typo. Alias is correct. See: https://httpd.apache.org/docs/2.4/mod/mod_alias.html (I could not edit answer because SO says you need to edit at least 6 characters......) – tkhm Nov 13 '20 at 14:28