Discussion:
How fix missing "/" in urls for this proxy setup?
(too old to reply)
Chris Seberino
2012-08-30 05:48:52 UTC
Permalink
I'm trying to make Apache be the proxy for an app running on
localhost.

Here is my Apache code below (Code below redirects all to HTTPS.)

My domain is sage.phil4.com. I am able to visit the login page and
log in.
After I do that the app tries to go to a page that Apache interprets
as
https://sage.phil4.comhome/admin instead of
https://sage.phil4.com/home/admin

(Notice missing / in the middle!)

Any help greatly appreciated.



<VirtualHost 72.14.188.15:80>
#
=============================================================================
ServerName sage.phil4.com
ServerAlias www.sage.phil4.com
DocumentRoot /var/www
Options Indexes FollowSymLinks
#
=============================================================================
<Directory /home/seb/MAIN/phil4/apache>
Order Allow,Deny
Allow from All
</Directory>
#
=============================================================================
Redirect / https://sage.phil4.com
#
=============================================================================
</VirtualHost>

<VirtualHost 72.14.188.15:443>
#
=============================================================================
ServerName sage.phil4.com
ServerAlias www.sage.phil4.com
DocumentRoot /var/www
Options Indexes FollowSymLinks
#
=============================================================================
<Directory /home/seb/MAIN/phil4/apache>
Order Allow,Deny
Allow from All
</Directory>
#
=============================================================================
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/sage.phil4.com.cert
SSLCertificateKeyFile /etc/apache2/ssl/sage.phil4.com.private_key
SSLCertificateChainFile /etc/apache2/ssl/sage.phil4.com.int_cert
#
=============================================================================
ProxyPass / http://127.0.0.1:8000/
ProxyPassReverse / http://127.0.0.1:8000/
#
=============================================================================
</VirtualHost>
Andre
2012-08-30 09:23:31 UTC
Permalink
Post by Chris Seberino
I'm trying to make Apache be the proxy for an app running on
localhost.
Here is my Apache code below (Code below redirects all to HTTPS.)
My domain is sage.phil4.com. I am able to visit the login page and
log in.
After I do that the app tries to go to a page that Apache interprets
as
https://sage.phil4.comhome/admin instead of
https://sage.phil4.com/home/admin
(Notice missing / in the middle!)
Any help greatly appreciated.
<VirtualHost 72.14.188.15:80>
#
=============================================================================
ServerName sage.phil4.com
ServerAlias www.sage.phil4.com
DocumentRoot /var/www
Options Indexes FollowSymLinks
#
=============================================================================
<Directory /home/seb/MAIN/phil4/apache>
Order Allow,Deny
Allow from All
</Directory>
#
=============================================================================
Redirect / https://sage.phil4.com
#
=============================================================================
</VirtualHost>
<VirtualHost 72.14.188.15:443>
#
=============================================================================
ServerName sage.phil4.com
ServerAlias www.sage.phil4.com
DocumentRoot /var/www
Options Indexes FollowSymLinks
#
=============================================================================
<Directory /home/seb/MAIN/phil4/apache>
Order Allow,Deny
Allow from All
</Directory>
#
=============================================================================
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/sage.phil4.com.cert
SSLCertificateKeyFile /etc/apache2/ssl/sage.phil4.com.private_key
SSLCertificateChainFile /etc/apache2/ssl/sage.phil4.com.int_cert
#
=============================================================================
ProxyPass / http://127.0.0.1:8000/
ProxyPassReverse / http://127.0.0.1:8000/
#
=============================================================================
</VirtualHost>
If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo_log"
# with ServerRoot set to "/usr/apache2217" will be interpreted by the
# server as "/usr/apache2217/logs/foo_log".

taken from apache's configfile ( ~/conf/httpd.conf )
André
Ivan Shmakov
2012-08-30 12:37:39 UTC
Permalink
[Somehow, I don't seem to see the original message on Aioe.]

[…]
Post by Chris Seberino
After I do that the app tries to go to a page that Apache interprets
as
https://sage.phil4.comhome/admin instead of
https://sage.phil4.com/home/admin
(Notice missing / in the middle!)
[…]
Post by Chris Seberino
Redirect / https://sage.phil4.com
My guess is that the following was actually meant instead:

Redirect / https://sage.phil4.com/
# If the filenames you specify for many of the server's control files
# begin with "/" (or "drive:/" for Win32), the server will use that
# explicit path. If the filenames do *not* begin with "/", the value
# of ServerRoot is prepended -- so "logs/foo_log" with ServerRoot set
# to "/usr/apache2217" will be interpreted by the server as
# "/usr/apache2217/logs/foo_log".
taken from apache's configfile ( ~/conf/httpd.conf )
My understanding is that ServerRoot cannot lead to any "missing
slashes" whatsoever.
--
FSF associate member #7257 http://sfd.am-1.org/
Continue reading on narkive:
Loading...