Hi,
I have a nginx conf file in which i want to block this particular url example-xyz.com.
I have added the following lines in my conf file.
server {
port_in_redirect off;
server_tokens off;
if ($http_host$request_uri != 'example-xyz.com') {
return 403;
break;
}
listen 80;
}
But this is not working, everytime i hit this url in my browser, it is opening fine.
Ideally it should return access forbidden.
Any suggestions.
I have a nginx conf file in which i want to block this particular url example-xyz.com.
I have added the following lines in my conf file.
server {
port_in_redirect off;
server_tokens off;
if ($http_host$request_uri != 'example-xyz.com') {
return 403;
break;
}
listen 80;
}
But this is not working, everytime i hit this url in my browser, it is opening fine.
Ideally it should return access forbidden.
Any suggestions.