Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

NGINX – allow IP range – invalid parameter

In order to allow range of IPs in NGINX, I add this row to my nginx configuration, in server declarative:

allow 165.165.165.0/255;

deny all;

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

When I test this modification (by sudo nginx -c /etc/nginx/nginx.conf -t) I got this error:

nginx: [emerg] invalid parameter "165.165.165.0/255" in
/etc/nginx/default.d/server.conf:1

What wrong?

Thanks

>Solution :

The error in your NGINX configuration is due to an incorrect IP range format. Use CIDR notation instead:

Replace allow 165.165.165.0/255; with allow 165.165.165.0/24;.

You can test the configuration again with sudo nginx -t and reload NGINX if successful.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading