A
A
Artem Kondratsky2019-03-22 09:03:04
Nginx
Artem Kondratsky, 2019-03-22 09:03:04

Why does Nginx only use the default site config file?

The server has Nginx version 1.10.3 installed.
There are two files in the /etc/nginx/sites-available folder: default and kondrackii.ru
Here is what is in the default file:

server {
        listen 80;
        listen [::]:80;

        root /var/www/html;

        index index.html index.htm;

        server_name _;

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

Here is what is in the kondrackii.ru file:
server {
        listen 80;
        listen [::]:80;

        root /var/www/kondrackii.ru/frontend;

        index index.html index.htm;

        server_name www.kondrackii.ru kondrackii.ru;

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

Through ln -s I made a symbolic link to the /etc/nginx/sites-enabled folder.
But when you enter the kondrackii.ru domain, nginx issues a standard site configuration file. How to fix it?
If you deactivate default, then no site works.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Fixid, 2019-03-22
@kondrackii

Show ls /etc/nginx/sites-available
Probably not linking due to wrong name

D
Dmitry, 2019-03-22
@Tabletko

Systemctl reload nginx

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question