Hi, i just host my site on WordOps.
When i see my 404 log I see my server IP with some kind of urls in there.
I opened my server ip and my site is opened.
So how do i exactly block accessing any hosted sites using IP in WordOps?
I found these:
https://community.wordops.net/d/548-how-to-block-direct-web-traffic-pointed-towards-servers-ip
https://community.wordops.net/d/579-how-to-deny-access-to-website-using-ip-address
https://www.digitalocean.com/community/questions/how-to-block-access-using-the-server-ip-in-nginx
https://stackoverflow.com/questions/29104943/how-to-disable-direct-access-to-a-web-site-by-ip-address
https://servernesia.com/2314/blokir-akses-website-ip-nginx/
Solutions from all above are working for HTTP, but not for HTTPS. The problem is i dont have any SSL and the browsers (Firefox/Chrome) can be forced to access website hosted on the server bypassing the warning.
in /etc/nginx/sites-enabled/default is this code
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
# Default server configuration
#
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
# include snippets/snakeoil.conf;
#
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # don’t use SSLv3 ref: POODLE
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
# fastcgi_pass unix:/var/run/php5-fpm.sock;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
thanks before.