Sign inSign up

fengal/docker-apache-proxy

By fengal

Updated over 8 years ago

a lightweight apache reverse proxy

Image
0

132

fengal/docker-apache-proxy repository overview

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 fengal/apache-proxy

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

docker run --name apache-proxy --volumes-from proxy-data -p 80:80 -d fengal/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

Tag summary

Content type

Image

Digest

Size

14.7 MB

Last updated

over 8 years ago

docker pull fengal/docker-apache-proxy