This repo is the companion to this blog post.
The default configurations here serve as a reverse proxy for the WordPress site in this project branch.
There are also some other NGINX conf examples here that can be used as a launch pad for more complex configurations.
The self-signed certificate in the ssl folder goes with the reverseproxy-ssl.conf examples and the fictitious coderevolve-site.com WordPress site. The certificate.pem and key.pem are self-signed and intended to be used as an example. You should NEVER commit valid, trusted certificate private keys to git.
- Install Docker Linux Users: Also install docker-compose
- Clone this repo:
git clone https://github.com/dawilk/coderevolve-docker-reverseproxy.git nginx
- Create the
reverseproxy
network:docker network create reverseproxy
- Execute
docker-compose up -d
from the directory with the docker-compose.yml file.
Modify the ./sites-enabled/coderevolve-site.conf template (or use one of the other examples) to suit your needs
- Replace
coderevolve-webhost
with the DNS name or IP of your web server (or container_name)- If the port of your web application is something other than 80, change it as well
- Replace
coderevolve-upstream
with whatever you want, just make it unique among any other upstreams - Replace
coderevolve-site.com
with your primary web address or tld for the site
If you want to remove this reverse proxy, do the following:
- Stop and remove the reverse proxy container:
docker-compose down
- Remove the docker network:
docker network remove reverseproxy
- Remove this folder, or just clean and reset it with
git clean -fdx
andgit reset --hard
- [optional] Remove the nginx docker image:
docker image rm nginx