A
A
alexh78542019-05-17 11:31:19
Nginx
alexh7854, 2019-05-17 11:31:19

Why is the site not accessible from www, where could there be an error in the nginx config?

Hello.
There is a local site, but it does not work if you open it from www in the url
site.com - www.site.com works - error
does not work What could be the problem? in the file /etc/hosts the site is specified like this nginx config
GsJgmSU.png
127.0.1.1 dcms.lo

server {
   listen 80;
   listen [::]:80;
 
   root /home/alex/mf/dcms/public;
 
   index index.php index.htm index.nginx-debian.html;
 
   server_name dcms.lo www.dcms.lo;
 
   location / {
     include  /etc/nginx/mime.types;
     try_files $uri $uri/ /index.php?$query_string;
   }
 
   location ~ \.php$ {
     include snippets/fastcgi-php.conf;
     fastcgi_pass unix:/run/php/php7.2-fpm.sock;
   }
 
   location /assets {
     alias /home/alex/mf/dcms/assets/;
     try_files $uri $uri =404;
   }
 
   location ~ /\.ht {
     deny all;
   }
 }

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladislav Lyskov, 2019-05-17
@Vlatqa

hosts
127.0.1.1 dcms.lo
127.0.1.1 www.dcms.lo

V
Viktor Taran, 2019-05-17
@shambler81

it's not about nginx show dns records of the domain

S
Sasha Petrov, 2019-05-23
@abc20002

On the tracker, try two site addresses. First, with www, then without, and on statistics and graphs, you will see the difference and where the legs of the problem grow from.
Paste it into the field and start the analysis: www.host-tracker.com/ru/InstantCheck/Create/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question