简体   繁体   中英

Running nginx in a container as reverse proxy with dynamic configuration

I'm trying to setup nginx as a reverse proxy in a container for my containers (Docker Swarm) and static sites which are being hosted on Google Cloud Platform & Netlify

I'm actually able to run nginx in containers, but I'm really worried about the configurations.

  1. How will I update my site configurations in nginx to all containers (add / remove location)?
  2. Is attaching a disk is the best option to store logs?
  3. Is there any fault in my architecture?

建筑

If image isn't working, please use this link - https://s1.postimg.org/1tv4hka3zz/profitto-architecture_1.png

Hej Sanjay.

Have a look at:

https://github.com/jwilder/nginx-proxy

https://traefik.io/

The first one is a modified Nginx Reverse Proxy by J.Wilder. The Second one is a new and native Reverse Proxy created specially for such use cases.

Both are able to listen to the docker.socks and dnynamicly add new containers to the reverse-proxy backend.

Regarding your Architecture: Why not running the Reverse-Proxy Containers inside the Swarm Cluster?

Related to logging, have a Look at the Docker Log-Drivers. You can collect the Logs of all Containers with eg. fluentd or splunk.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM