גיאו-חסימה באמצעות Nginx של הקונטיינר?

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

לאחר חיפוש מהיר בגוגל, נראה שאני צריך להשתמש בתבניות, כפי שהוצע, ו/או בתוסף. אחרת הכל יידרס.

לחלופין, אני צריך להשתמש ב-reverse proxy מחוץ לקונטיינר.

נכון?

כן, אבל אם אתה טוב ב-nginx, סביר להניח שזה לא קשה מדי ליצור תבנית (או להוסיף שורות ל-app.tml שלך) שעושה את מה שאתה רוצה.