0

I have searched high and low for an answer to this an for the life of me can't find one, is it even possible?

What I need to do is:

Only allow connection to NGINX from a certain domain, and only allow connections to NGINX from a certain IP

So allow all conections coming in from the domain specified and the IP specified and return 444 for anything else

These need to be on the same NGINX instance.

If anyone can be a help here I would be very greatful

Thank You

  • You can try to achieve this with the 3rd party [rDNS module](https://github.com/flant/nginx-http-rdns), but I don't know if you can combine its rules with the native nginx `access`/`deny` directives. – Ivan Shatsky Aug 18 '21 at 16:02
  • Sorry forgot to mention that I am unable to install any new modules to the NGINX installation. – Paul Townsend Aug 19 '21 at 11:56
  • As far as I know, there is no way to build rules based on domain names without additional nginx modules. If you're using OpenResty, there can be a way to write something similar with the lua code. Otherwise I think it's impossible. Or maybe you can use firewall rules instead. – Ivan Shatsky Aug 19 '21 at 12:04

0 Answers0