Welcome! Log In Create A New Profile

Advanced

What is best way of hiding server IP?

Posted by tommygunner 
What is best way of hiding server IP?
August 01, 2017 12:44PM
I have a domain name that I use with Nginx 1.13 and don't want to to have IP resolvable via browser. I was trying to do this in the /etc/nginx/conf.d/default.conf but was stilling getting 403 error message so then created another config file under sites-enabled with the following:

server {
listen 80 default_server;
server_name 0.0.0.0;
return 444;
}

(Replace 0.0.0.0 for privacy but my real IP in there on my end). It works fine now and doesn't return any pages for the IP address but am wondering if this is the best way. Is there another way that is better?
Re: What is best way of hiding server IP?
August 02, 2017 04:58AM
Our web-servers have multiple IPs so we do it using:

if ( $http_host ~* "^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$" ) {
return 444;
}
Re: What is best way of hiding server IP?
August 02, 2017 01:35PM
Thanks. I only have one IP for the VPS server.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 210
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready