Is it necessary to install nginx in front of docker?

It depends on what @doudou wants to do. If the machine is only hosting Discourse, no webserver is required besides the nginx provided by and installed inside the Discourse docker container. In the case that he wants to host other content on the same machine, he will have to run a webserver on the host and reverse-proxy to Discourse, but

  1. pretty much any webserver that handles many long-lasting connections well will do; nginx is recommended because it does this by default, but Apache will do as well if it is configured properly.

  2. the second nginx inside the container is not strictly required. the host webserver can reverse-proxy directly to the Discourse app server (unicorn). However, this is not recommended because the container’s nginx is configured with Discourse in mind and a non-ideal self-made config could impact performance more significantly than running the request through another proxying nginx instance…

2 likes