I have the following nginx config, e.g.
server {
listen 80;
server_name example.com
allow 127.0.0.0/8;
When I restart, it warn me:
Restarting nginx: nginx: [warn] server name "127.0.0.0/8" has suspicious
symbols in /etc/nginx/sites-enabled/xxx
Any idea?
I guess you are missing the
;
at the end of theserver_name
directive so it interprets theallow
line as part of the server name.For me the cause of this error was having 'http://' in the server_name.
i.e. I changed this:
To this:
A simple directive consists of the name and parameters separated by spaces and ends with a semicolon (;).
In your case server_name example.com semicolon (;) is missing.
In my case error was in website url
so I modified it this way
and when I tried
it worked for me