Question

IP address worked but domain name does not

Domain name is registered and DNS is pointed to DO as per tutorial. Created “A” record for fireball.design and www.fireball.design and *.fireball.design. Also created Nginx server block for fireball.design in /etc/nginx/sites-available/ with same names under “Server”. I was able to access by IP address only and I figured it just need time to register. I had a working wordpress install and to see if I could get it working after few days with the domain name I changed in Wordpress admin >Settings>General>Wordpress Address and Site Address URL from 104.248.211.55 to fireball.design. It could not load and now I am logged out and can not bring up any page at all. Any ideas?

Here is the nginx config. Just a guess but maybe Nginx can not find this correct nginx config file for fireball.design and is loading another default config file and is crapping out. Strange that it was working with the ip address and then after just that one change in the wordpress admin I can not even get a proper error page and if I type in the ip address in the browser it rewrites it to fireball.design so it seems the DNS mapping is working but I don’t know.

This is a fresh install with the LEMP one click install and did the HTTPS config running Certbot (this may be the culprit). Created a sybolic link with sudo ln -s /etc/nginx/sites-available/fireball.design /etc/nginx/sites-enabled/ Unlinked the default with sudo unlink /etc/nginx/sites-enabled/default.

sudo ufw status

Status: active

To                         Action      From
--                         ------      ----
22/tcp                     LIMIT       Anywhere
443/tcp                    ALLOW       Anywhere
80/tcp                     ALLOW       Anywhere
Nginx Full                 ALLOW       Anywhere
OpenSSH                    ALLOW       Anywhere
22/tcp (v6)                LIMIT       Anywhere (v6)
443/tcp (v6)               ALLOW       Anywhere (v6)
80/tcp (v6)                ALLOW       Anywhere (v6)
Nginx Full (v6)            ALLOW       Anywhere (v6)
OpenSSH (v6)               ALLOW       Anywhere (v6)

Here is the server block code -when pasted in here it looks strange

server {


	# SSL configuration
	#
	# listen 443 ssl default_server;
	# listen [::]:443 ssl default_server;
	#
	# Note: You should disable gzip for SSL traffic.
	# See: https://bugs.debian.org/773332
	#
	# Read up on ssl_ciphers to ensure a secure configuration.
	# See: https://bugs.debian.org/765782
	#
	# Self signed certs generated by the ssl-cert package
	# Don't use them in a production server!
	#
	# include snippets/snakeoil.conf;

	listen fireball.design;

	server_name fireball.design www.fireball.design *.fireball.design 104.248.211.55;

	client_max_body_size 256M;

	root /var/www/fireball.design/fireball_wp_1/;
	
	# Add index.php to the list if you are using PHP
	index index.php index.html index.htm index.nginx-debian.html;


	location = /favicon.ico { log_not_found off; access_log off; }
   	location = /robots.txt { log_not_found off; access_log off; allow all; }
   	location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
        expires max;
        log_not_found off;
    	}

	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		# try_files $uri $uri/ =404;
		try_files $uri $uri/ /index.php$is_args$args;
	}

	# pass PHP scripts to FastCGI server
	#
	location ~ \.php$ {
		include snippets/fastcgi-php.conf;
		include fastcgi.conf;
	#	fastcgi_index  index.php;
	#
	#	# With php-fpm (or other unix sockets):
		fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
	#	# With php-cgi (or other tcp sockets):
	#	fastcgi_pass 127.0.0.1:9000;
	}

	# deny access to .htaccess files, if Apache's document root
	# concurs with nginx's one
	#
	 location ~ /\.ht {
		deny all;
	}

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/fireball.design/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/fireball.design/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#	listen 80;
#	listen [::]:80;
#
#	server_name example.com;
#
#	root /var/www/example.com;
#	index index.html;
#
#	location / {
#		try_files $uri $uri/ =404;
#	}
#}

server {

    if ($host = www.fireball.design) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = fireball.design) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


	listen 80;
	listen [::]:80;

	server_name fireball.design www.fireball.design;
    return 404; # managed by Certbot

}
```
Show comments

Submit an answer


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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Tried the Fail2ban stuff but nothing worked and even uninstalled it. Tried lots of other things. I give up 3 weeks later for a simple LEMP stack with Wordpress. One click garbage installs. Can somebody delete this whole question entry

GO to the company from where you bought the domain name, for example google domains. They will have one option to bind the IP address of your server to the domain name by using DNS A, AAAA, NS, PTR, CNAME records. Once these are set, the name will resolve to IP address and the IP Address will resolve to the name. I just did the same for my Servers based on Django! Thanks for asking!!

Nothing works I give up Can someone delete this entire post

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.