0

In Nginx the allow directive (from module ngx_http_access_module) does not seem to work with domains. It just seems to work with IP.

Why would that be useful, you ask? Let's say you want your family to access your service without being asked for a password.
Family members could use dynamic DNS to map their IP to a certain domain (say: name.hopto.org from a service like No-IP, for example). In that case, one could code it the following way:

    allow 192.168.1.70;      #For an internal IP, for example.
    allow name.hopto.org;    #For a known external domain, for example.
    deny  all;

However, since this does not work, what other elegant alternatives are there? Don't want to end up resorting to cron jobs to update the IPs...
Why doesn't Nginx resolve the domain to an IP address? Is there a module that can do that?

Pedro Abrantes
  • 153
  • 1
  • 7
  • What if you were to run your service on HTTPS, and give only the people you want to allow in, a key? – Gerard H. Pille May 07 '20 at 11:01
  • Ideally, anyone on that household should have access to the service, not just the ones I had shared a key with. It would also make it a little cumbersome to add new people. – Pedro Abrantes May 07 '20 at 12:44
  • Probably a username and password will be the least bother. Whatever is using your service just has to store it. – Gerard H. Pille May 07 '20 at 15:07
  • But surely I can't be the only one wishing for this, and there should be a clever way to implement what I'm trying to achieve... There are stupid ways of implementing it like using iptables to direct to a different port which nginx would serve the same content but without password... But surely there is a simpler solution... – Pedro Abrantes May 07 '20 at 15:37
  • Facial recognition perhaps? – Gerard H. Pille May 07 '20 at 15:49
  • :) Funny! But I'm thinking maybe there is a less basic PAM module that has the capability that ngx_http_access_module seems ti lack: resolve a domain to an IP... – Pedro Abrantes May 07 '20 at 15:53

0 Answers0