S
S
SVAY2020-10-23 15:03:21
Nginx
SVAY, 2020-10-23 15:03:21

How to set up a subdomain for nginx?

server {
        listen 80;
        root /srv/s.3op.space;
server_name example.com;
        index index.php

        location / {
                try_files $uri $uri/ =404;
        }

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        }

        location ~ /\.ht {
                deny all;
        }
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AbramovKS, 2020-10-23
@AbramovKS

I would check all the same in the NGINX logs what path is requested, what is returned 404.
Maybe there really is no path to the file.
root /srv/s.3op.space/public; this one, for example, or the index file in it.

S
SVAY, 2020-10-24
@SVAY

The problem resolved itself. When requesting the s.3op.space path, the 404 page of the host was returned, not nginx, which probably had problems.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question