Redirecting a subdomain to a port; not working,

server {
        listen         8080 default_server;
        listen         [::]:8080 default_server;
        server_name    cad.domain.tech;
        root           /var/www/cad;
        index          index.php;

          location ~* \.php$ {
            fastcgi_pass unix:/run/php/php7.2-fpm.sock;
            include         fastcgi_params;
            fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;
            fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;
          }
        } 

I have this in my NGINX site-availables, and when I do IP:8080 I get the webpage I put in there. However, when I do cad.domain.tech I get “server not found”.

Here are my page rules and DNS settings:


Anybody have any ideas?

From what you’re describing, you’re trying to forward it to itself, but on a different port. I don’t think that’s going to work.