Geoblocking met Nginx van de container?

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.

1 like

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.