Answer the question
In order to leave comments, you need to log in
Have I blocked access to the site for all users and crawlers using deny all?
Hello, please tell me, I just want to make sure I understand everything correctly.
There is this configuration:
server {
deny all;
server_name domain.ru;
root /var/www/user/chroot/domain;
index index.html index.htm index.php;
location / {
root /var/www/user/chroot/domain;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
}
location ~* ^.+\.(js|css|svg|jpg|png|ico|pdf|woff2|woff|ttf)$ {
expires max;
}
location = /favicon.svg { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/www/user/chroot/tmp/php.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
if ($request_uri ~ "^(.*)index\.(?:php|html)") {
return 301 $1;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/domain/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/domain/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
deny all;
if ($host = domain.ru) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name domain.ru;
listen 80;
return 404; # managed by Certbot
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question