Answer the question
In order to leave comments, you need to log in
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 config127.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
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 questionAsk a Question
731 491 924 answers to any question