Jump to content

Apache Reverse Proxy


dimaj

Recommended Posts

Hey guys,

So, earlier I've asked a question about mod_rewrite to get rid of the annoying port number from the url. Sparda recommended that I should switch my router configuration to forward port 80 to port 80 of my web server. I did just that.

Later I have discovered that with mod_proxy I can tunnel all of my other web applications from other web servers through my main web server. So, I've set up something like this:

ProxyRequests Off
ProxyPreserveHost On
SSLProxyEngine On

# These work just fine. I just have to put a '/' at the end of my url
ProxyPass /blah http://localhost/blah
ProxyPassReverse /blah http://localhost/blah
ProxyPass /blah2 http://other_server:1234/app
ProxyPassReverse /blah2 http://other_server:1234/app

# Displays page's source code as opposed to rendering the page
ProxyPass /ssl https://other_server:8080/app2
ProxyPassReverse /ssl https://other_server:8080/app2

# Changes URL in my browser to http://www.google.com
ProxyPass /external http://google.com
ProxyPassReverse /external http://google.com

Here are some problems that I'm experiencing and cannot find an answer to:

1) Why do I have to put a trailing / at the end of my url? (e.g. http://mydomain.com/blah/'>http://mydomain.com/blah/ as opposed to http://mydomain.com/blah)

2) When I try to access http://mydomain.com/ssl/, I get to the requested page, but I see its source as opposed to the rendered site. (Just noticed that it works fine in IE, but not on Chrome :unsure: )

3) When I try to access http://mydomain.com/external/, my URL changes to http://google.com. How come? I thought that I'm tunneling it through my web server.

Also, somewhat related question...

How can I setup an http proxy such that I could access a web page on my web server, pass in the url of the web site I want to visit and have that web site displayed on my computer (which is behind a corporate proxy)?

P.S. I'm running an apache2 web server on Ubuntu.

Thanks for the help.

dimaj

Link to comment
Share on other sites

For your first question, might want to read up on this doco. http://httpd.apache.org/docs/2.0/mod/mod_dir.html

For your last question, if you want to serve webpages from your webserver, through a proxy server Squid Proxy, might just allow you do to that.

Edited by Infiltrator
Link to comment
Share on other sites

How can I setup an http proxy such that I could access a web page on my web server, pass in the url of the web site I want to visit and have that web site displayed on my computer (which is behind a corporate proxy)?

Few ways.

1 VPN to or SSH Proxy to the home machine to surf through it

2 Run PhProxy on the home server, and access it on normal port 80, so long as the corporate network allows you to reach the home machine on port 80

Both of these options will probably get you fired if you got caught. Do what you want at your own risk.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...