Closed honi closed 2 weeks ago
Hi,
If you want your own custom "redirector" you can just mount your configs to the /etc/nginx/conf.d/
folder instead, and thus overwriting anything that is already inside the container.
Then you can do whatever you want with the port 80 server block, but you will need to define the same "well-known" ACME location so Certbot works as expected with the HTTP challenge.
However, I would probably go with fail2ban and block bad client connections immediately before even getting to Nginx.
Any update to this?
The defaullt
redirector.conf
redirects all http traffic to https except the HTTP-01 ACME challenges. I understand the main reason behind this and it's a nice feature. But I'm getting spammed with scrapers and bots with an invalid host header reaching my Python/Django app.I would like to drop this traffic at the proxy level. What's the recommended approach here? Should I override the
redirector.conf
to remove the redirect, and then add it only in my app server block which has a concreteserver_name
?As mentioned here, adding a default https server generated a ton of other nginx related errors because it's missing the certificate config.