Skip to content

jdrago999/nginx-docky-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nginx-docky-proxy

The NGINX reverse proxy for development environments in Docker containers.

Why did you do this?

Because docker-compose dev environments can be tricky when it comes to https, port numbers, hostnames, multiple layers of VMs and getting all that to line up nicely.

What does it do?

Your Browser -> docker-machine -> nginx -> yourcontainer

  • We use NGINX to accept all requests over SSL using a self-signed certificate.
  • We update sites-enabled/default to specify our "upstream" hosts.
    • An upstream host is your web application running on another container.
  • NGINX will forward requests directly to the correct container and return the result.
    • Currently, all requests are performed over SSL.
    • If you don't want SSL, then update sites-enabled/default:
      • change this proxy_pass https://$host;
      • to this: proxy_pass http://$host;

Instructions for Use

  • Add upstream configs to sites-enabled/* to match your proxy needs.
## file: sites-enabled/somecontainer

upstream somecontainer {
  server somecontainer:443;
}
  • Update your /etc/hosts to match $(docker-machine ip) somecontainer
  • build via:
    • docker build -t myproj/nginx:$(date +"%Y%m%d") .
  • Use in your docker-compose.yml
...
nginx:
  image: myproj/nginx:1234567890
  volumes:
    - nginx/sites-enabled:/etc/nginx/sites-enabled
  ports:
    - 443:443

About

Make docker development environments great again!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages