Я настроил новое приложение php 5.6 на новом сервере Ubuntu 16.04, используя Nginx 1.10, php5.6-fpm,
Когда я попытался настроить phpmyadmin, чтобы открыть его, используя мой URL-адрес приложения «http : //myapp.com/pm ", он говорит, что доступ запрещен, с последующей ошибкой в моем журнале nginx:
2017/05/31 12:39:37 [error] 30267#30267: *9 FastCGI sent in stderr: "Access to the script '/var/www/html' has been denied (see security.limit_extensions)" while reading response header from upstream, client: xxx.xxx.xxx.xx, server: myapp.com, request: "GET /pm HTTP/1.1", upstream: "fastcgi://unix:/run/php/php5.6-fpm.sock:", host: "myapp.com"
Моя конфигурация vhost:
server {
listen 80;
server_name myapp.com;
index index.php index.html index.htm;
root /var/www/myapp/;
access_log /var/log/nginx/myapp_access.log;
error_log /var/log/nginx/myapp_error.log;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location /pm {
root /var/www/html;
index index.php;
try_files $uri $uri/ =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php5.6-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ \.php {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_index index.php;
fastcgi_pass unix:/run/php/php5.6-fpm.sock;
fastcgi_read_timeout 18000;
}
}
И Путь phpmyadmin:
ls -l /var/www/html/
total 4
-rw-r--r-- 1 www-data www-data 612 May 24 17:46 index.nginx-debian.html
lrwxrwxrwx 1 www-data www-data 22 May 25 17:01 pm -> /usr/share/phpmyadmin/
Любая помощь, пожалуйста?
(Источник)
(Источник)