
Theng Ung <thengsta@yahoo.com.au> writes:
Just want to ask anyone that know how Apache reverse proxy work. web server running on windows server with internal ip 192.168.1.20. DNS record for www.abcd.com.au with 203.x.x.10.
Please do not censor information when asking for help. Something you censor might turn out to be relevant, and cause us to waste our time and yours giving faulty answers.
Below is the config from /etc/apache2/site-enable
Recommend you copy-and-paste paths &c, since you mistyped the one above.
<VirtualHost *> ServerName mail.abcd.com.au ServerAlias *.abcd.com.au RewriteEngine on RewriteRule /.* http://www.abcd.com.au/
This is wrong in every way. Here is a real one I use, that reverse proxies https://webmail.cyber.com.au (served by epoxy.cca) to the backend host called "webmail" on the inside of the network (split horizon DNS). The listener on 80 simply redirects users too lazy to type "https://". <VirtualHost *:443> ServerName webmail.cyber.com.au ServerAlias webmail ServerAdmin responsible-epoxy-webmail@cyber.com.au SSLEngine on SSLProxyEngine On ProxyPass / https://webmail-noauth/ ProxyPassReverse / https://webmail-noauth/ <Location /> Include /etc/apache2/ldap-ssl.conf </Location> # Censor clear-text LDAP passwords to backend. RequestHeader unset Authorization </VirtualHost> # If the user forgets to specify HTTPS, redirect them. <VirtualHost *:80> ServerName webmail.cyber.com.au ServerAlias webmail ServerAdmin responsible-epoxy-webmail@cyber.com.au Redirect / https://webmail.cyber.com.au/ </VirtualHost> That is a little confusing, so a barebones version (untested): <VirtualHost *:80> ServerName foo.example.net ServerAlias foo ServerAdmin idiot+foo.example.net@gmail.com ProxyPass / http://foo-backend.example.net/ ProxyPassReverse / http://foo-backend.example.net/ </VirtualHost> I don't remember why I'm specifying ProxyPass as well. I recommend you read httpd.apache.org/docs and talk to the good folk of #httpd on irc.freenode.net. Also, using non-breaking spaces in email is mildly annoying.