Skip to content

About

Apache web server like proxy to Docker

Resources

Stars

0 stars

Watchers

1 watching

Forks

 
 

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Apache Proxy on Docker

Table of Contents

  1. Introduction
  2. Deploy
  3. Recommended
  4. SSL Support

Introduction

Apache web server like proxy to Docker.

Enable modules :

  • proxy
  • proxy_http
  • ssl

Deploy

  • First, create an data container to storage your web site configuration
docker create --name proxy-data --volume /opt/proxy-conf/:/opt/proxy-conf busybox /bin/true
  • Then, create proxy container with link data volume. By default, the data volume is mountend in /opt/proxy-conf. All configurations of this website in this directory will be activated
docker run --name apache-proxy --volumes-from proxy-data -p 80:80 -d diouxx/apache-proxy

Recommended

I recommanded to link also web site container. It's just my advice

docker run --name apache-proxy --link sitecontainer:sitecontainer --volumes-from proxy-data -p 80:80 -d diouxx/apache-proxy

And an exemple proxy configurations

<VirtualHost *:80>
	ServerName yoursite.domain.com

	ProxyPass "/" "http://sitecontainer/"
	ProxyPassReverse "/" "http://sitecontainer/"

</VirtualHost>

SSL Support

To use Apache proxy with HTTPS :

  • First, configure your virtual host with SSL support
<VirtualHost *:80>
        ServerName yoursite.domain.com

        ProxyPass "/" "http://sitecontainer/"
        ProxyPassReverse "/" "http://sitecontainer/"

</VirtualHost>

<VirtualHost *:443>
        ServerName yoursite.domain.com

        SSLEngine On

        SSLCertificateFile /opt/ssl/yourcertificate.crt
        SSLCertificateKeyFile /opt/ssl/yourcertificate.key

        ProxyPass / http://sitecontainer/
        ProxyPassReverse / http://sitecontainer/


</VirtualHost>
  • Then, link your SSL certificate folder by volumes. Example :
docker run --name apache-proxy --volumes yourssldirectory:/opt/ssl/ --volumes-from proxy-data -p 80:80 -p 443:443 -d diouxx/apache-proxy

About

Apache web server like proxy to Docker

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages