Skip to content

Instantly share code, notes, and snippets.

@nkabir
Created February 23, 2012 18:52
Show Gist options
  • Select an option

  • Save nkabir/1894312 to your computer and use it in GitHub Desktop.

Select an option

Save nkabir/1894312 to your computer and use it in GitHub Desktop.
Apache Https VirtualHost
NameVirtualHost *:80
Listen 80
<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
NameVirtualHost *:443
Listen 443
</IfModule>
# a2enmod proxy
# atenmod proxy_http
NameVirtualHost *:443
<VirtualHost *:80>
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "/var/www"
ServerName stemsrv01
ServerAdmin sysadmin@rocketknowledge.com
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache2.pem
SSLProxyEngine on
RewriteEngine On
RewriteRule ^/$ /phpldapadmin [L,R]
RequestHeader set Front-End-Https On
ProxyRequests On
ProxyPreserveHost On
ProxyVia full
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /phpldapadmin http://internal_name/phpldapadmin
ProxyPassReverse /phpldapadmin http://internal_name/phpldapadmin
# ProxyPass /exchweb https://mxbsas.example.local/exchweb
# ProxyPassReverse /exchweb https://mxbsas.example.local/exchweb
# ProxyPass /public https://mxbsas.example.local/public
# ProxyPassReverse /public https://mxbsas.example.local/public
# ProxyPass /exchangerng https://mxrng.example.local/exchangerng
# ProxyPassReverse /exchangerng https://mxrng.example.local/exchangerng
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment