Geoblocking met Nginx van de container?

AI-generated summary

Jagster asks about geoblocking using Nginx within a Discourse container, expressing concerns about changes being overwritten during upgrades. elmuerte suggests creating a template to include custom Nginx configurations in the container. Jagster confirms that using templates or plugins is necessary to avoid overwrites. pfaffman agrees, suggesting that creating a template or modifying the app.yml file is a viable solution.

Sorry, this is pure 101 question. But I know how to use Nginx to block problematic countries, aka. geoblocking, and stop unwanted user agents. I could use a reverse proxy front of Discourse, I’ve done that before, but I don’t know anything about containers. Heck, I don’t even understand how docker works in the first place.

So, can I use same Nginx what Discourse uses? Or putting the same on more simplier way: can I do same stuff inside a container that I would/could do outside it? Or would all changes be overwritten when I next time do upgrading?

I’m trying to avoid using extra Nginx as a reverse proxy, because I don’t like questions like is your setup as recommended :joy:

To saving time I started here, not with AI. LLMs has tendency to be 80% accurate, and that missing 20% would be really time consuming…

I know this question won’t be suitable here, but this isn’t defenetly a support question either. Please, feel free to move it somewhere else.

I would create a template that you include in the docker container which is created by the launcher.

For example like this rate limiting template which makes changes to the nginx setup: discourse_docker/templates/web.ratelimited.template.yml at main · discourse/discourse_docker · GitHub

You would include your own template in the templates: list of your container yml configuration.

The next time you rebuild it, your changes to the nginx configuration will be included.

Na snel googelen lijkt het erop dat ik templates moet gebruiken, zoals voorgesteld, en/of een plugin. Anders wordt alles overschreven.

Of ik moet een reverse proxy buiten de container gebruiken.

Juist?

Ja, maar als je goed bent met nginx, is het waarschijnlijk niet al te moeilijk om een template te maken (of regels toe te voegen aan je app.tml) die doet wat je wilt.