Skip to content
This repository was archived by the owner on Oct 28, 2021. It is now read-only.

summitmedia/pmg-docker-ngnix-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pmg-docker-ngnix-proxy

Default nginx-proxy container for mapping hostname to correct Docker application container.

Use

  1. On your host (web) server, clone pmg-docker-ngnix-proxy into your web root.

  2. Navigate into pmg-docker-nginx-proxy.

  3. Run docker network create front.

  4. Run docker-compose up -d --build.

  5. Following the nginx-proxy example docker-compose.yml, add the code to your application's Docker Compose file.

  6. Define the ports to avoid collisions with other applications, making sure to map to the default port. e.g.

    services:
      web:
        image: web
        environment:
          VIRTUAL_HOST: mysite.com
        ports:
          - "8080:80"
  7. Define the following network your application's Docker Compose file (at the bottom of the file, outside of services):

    networks:
      front:
        external: true
  8. Use the front network on the desired services by adding:

```yml
networks:
  - front
```

e.g.

```yml
services:
  web:
    image: web
    container_name: web
    networks:
      - front
```
  1. Commit, push, and pull on your host (web) server.
  2. Run docker-compose up -d --build or a custom build script.

Setting Up Basic Authentication Support

To secure your virtual host, create a htpasswd file named as its equivalent VIRTUAL_HOST variable in config/htpasswd.

For example, if you have VIRTUAL_HOST: more.cool.com, create a htpasswd file at config/htpasswd/more.cool.com.

How to Create an htpasswd file

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors