We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
How to block direct IP Access?
How to block direct IP Access?
Hi,
If I go to my IP address, I go to my first website. I don't want this.
How can they see a 403 error message?
This is what I have tried:
in
/etc/nginx/conf.d/default.conf
and
/etc/nginx/nginx.conf
I restarted nginx multiple times but if I go to my IP address it is not showing the 403 message. What am I doing wrong?
If I go to my IP address, I go to my first website. I don't want this.
How can they see a 403 error message?
This is what I have tried:
Code: Select all
server {
listen 80;
listen 443;
return 403;
}
in
/etc/nginx/conf.d/default.conf
and
/etc/nginx/nginx.conf
I restarted nginx multiple times but if I go to my IP address it is not showing the 403 message. What am I doing wrong?
Re: How to block direct IP Access?
Try adding server_name directive before return :
server {
listen 80;
listen 443;
server_name IP_ADDRESS;
return 403;
}
server {
listen 80;
listen 443;
server_name IP_ADDRESS;
return 403;
}