0

I've tried this with both apache and nginx servers (separately, not at the same time). Both default servers have served content properly to the IP address but not to the domain name "b-t.dev". This applies both for the default "nginx/apache server is up and running" status page as well as for the PicoCMS installation I'm trying to debug here.

I've used other browsers and other devices so it's not a client caching issue.

This is my first time setting up these servers, so I'm probably missing something obvious.

Here are some status outputs:

pico.conf

/etc/nginx/sites-available/pico.conf (symlinked to sites-enabled/ of course):

server {
        listen 80;
        server_name 195.201.89.229 b-t.dev;
        root /var/www/html/pico;
        index index.php index.html index.htm;

        location / {
                try_files $uri $uri/ /index.php;
        }

        access_log /var/log/nginx/pico.access.log;
        error_log /var/log/nginx/pico.error.log;

        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_buffer_size 16k;
                fastcgi_buffers 4 16k;
        }

}

Hetzner DNS administration

Hetzner has confirmed that my client is contacting the server, as this issue indicated might be a problem.

# ping b-t.dev
PING b-t.dev (195.201.89.229) 56(84) bytes of data.
64 bytes from static.229.89.201.195.clients.your-server.de (195.201.89.229): icmp_seq=1 ttl=58 time=0.503 ms

Firewall status: $ sudo ufw status Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
mosh                       ALLOW       Anywhere
22/tcp                     ALLOW       Anywhere
80/tcp                     ALLOW       Anywhere
443/tcp                    ALLOW       Anywhere
Apache                     ALLOW       Anywhere
Nginx HTTP                 ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)
mosh (v6)                  ALLOW       Anywhere (v6)
22/tcp (v6)                ALLOW       Anywhere (v6)
80/tcp (v6)                ALLOW       Anywhere (v6)
443/tcp (v6)               ALLOW       Anywhere (v6)
Apache (v6)                ALLOW       Anywhere (v6)
Nginx HTTP (v6)            ALLOW       Anywhere (v6)

systemctl status

$systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2020-12-03 22:16:00 CST; 17h ago
       Docs: man:nginx(8)
    Process: 5060 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 5069 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
   Main PID: 5074 (nginx)
      Tasks: 2 (limit: 2286)
     Memory: 3.0M
     CGroup: /system.slice/nginx.service
             ├─5074 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
             └─5075 nginx: worker process

It seems like I could simply set up a redirect from the IP address to the domain name, but seems like a band-aid solution, no?

Karoh
  • 155
  • 2
  • 7

0 Answers0