is it possible to block HTTPS using the IP address?
So that you cannot access my website using the IP address with HTTPS port 443.
Thanks in advance!
is it possible to block HTTPS using the IP address?
So that you cannot access my website using the IP address with HTTPS port 443.
Thanks in advance!
4
Answers
You can specify only a listen port in Nginx configuration.
The application will be exposed only by the Nginx listen port
Just add listen to 443 and change the server_name with your IP address, so it looks like this:
Don’t forget to check the syntax if it is successful or not:
sudo nginx -t
And reload your Nginx server:
sudo systemctl reload nginx
Found this thread on my own search for a solution. The site linked below posts a solution to reject any unconfigured ssl requests. It worked well for what I needed.
https://www.zacharyschneider.ca/2020/03/nginx-block-direct-ip-access/
Code block included for ease of access, all credit to zacharyschneider.ca for this solution.
You can deny all and reject connections for unknown domains, when somebody tries to use IP:80 and IP:443.
Response for HTTP(80): Connection closed without response.
Response for HTTPS(443): Reject SSL connection.
Include this config to /etc/nginx/nginx.conf: