iutbay / yii2-kcfinder

KCFinder for Yii2
22 stars 19 forks source link

Nginx error 403 Forbidden #19

Open tatasutiadi opened 6 years ago

tatasutiadi commented 6 years ago

Helloo im using server nginx n im promplem with error 403 Forbidden. before im using apache and work. ` server{ charset utf-8; client_max_body_size 128M; listen 85;

root /var/www/html/project/web;
server_name localhost:85 localhost:85;
index index.php;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

location / {            
    try_files $uri $uri/ /index.php?$args;
}

location ~ ^/assets/.*\.php$ {
    deny all;
}

location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/run/php/php7.1-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

location ~* /\. {
    deny all;
}

}`

execut commented 5 years ago

I solved this problem by comment out this lines:

location ~ ^/assets/.*\.php$ {
    deny all;
}

but it is an unsafe solution