Answer the question
In order to leave comments, you need to log in
nginx config, 403 forbidden error. Why can't nginx see index.php in the public folder?
Nginx gives a 403 error, for some reason it does not see index.php in the public folder, but if you create index.php in the root of the project, right in the crm folder, everything works fine, but this is not a solution, breaking the project structure on symfony 4.
I tried to install root /var/www/crm/public , but then it already gives a 404 error
upstream php {
server unix:/var/run/php/php7.2-fpm.sock;
}
server {
listen 80 default_server;
client_max_body_size 100M;
server_name crm.at.npo;
root /var/www/crm;
index index.php
server_name crm.npo-at.com;
access_log /var/www/crm/var/log/access.log;
error_log /var/www/crm/var/log/error.log;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass php;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_read_timeout 600;
}
location ~* \.(exe|rar|max|js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
}
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