Конфигурация Nginx для подпапки
На домене работает приложение Laravel. В корневую директорию был закинут форум flarum. В location указан путь к нему, но при переходе на do.main.com/forum - 403 ошибка. С правами все в порядке. Каталоги видит. Правильно ли я настраиваю Nginx?
server {
listen 80;
listen [::]:80;
listen 443;
listen [::]:443;
root /var/www/mysite/public;
index index.php index.html index.htm index.nginx-debian.html;
server_name do.main.com;
include snippets/phpmyadmin.conf;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ^~ /forum/ {
root /var/www/mysite/public/forum/public;
index index.php;
location ~ \.php$
{
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
include snippets/forum-nginx.conf;
}
location ~ \.php$
{
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}