Answer the question
In order to leave comments, you need to log in
Setting up nginx with a slash at the end, the site is no longer available, why?
Hello, I started setting up NGINX so that the site would be accessible with a slash at the end, it turned out that slashes https://photo-gileva-olga.ru/blog/ were added to all routes, but for some reason the root of the site is https://photo- gileva-olga.ru/ status 403 Forbidden is no longer available.
server {
listen 80;
listen 443 ssl;
server_name photo-gileva-olga.ru;
root /var/www/photo-gileva-olga/public;
if ($request_uri ~ "^(.*)index\.(?:php|html)/(.*)") {
return 301 $1$2;
}
if (!-f $request_filename) {
rewrite [^/]$ $uri/ permanent;
}
if ($request_uri ~ ^(?P<left>[^?]*?)//+(?P<right>[^?]*)) {
rewrite ^ $left/$right permanent;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass php:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
internal;
}
location ~ \.php$ {
return 404;
}
error_log /var/log/nginx/photo-gileva-olga_error.log;
access_log /var/log/nginx/photo-gileva-olga_access.log;
}
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