Hello everyone. My recently installed Ghost site is working well, but after the install and domain propagation, I can still access through the public IP.
How can I prevent that from happening? I’ve tried some guides for redirecting the IP to my domain using the nginx config but nothing worked.
I’m currently using two server blocks at the end of default at /etc/nginx/sites-available
server {
server_name xxx.xxx.xxx.xx;
return 301 https://site.com;
}
server {
listen 443;
server_name https://site.com;
return 403;
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Configure catch-all server:
server {
listen 80 default_server;
server_name "";
return 444;
}
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.