listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /var/www/vsdesk2/;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
# DIR /
location / {
root /var/www/vsdesk2;
index index.php index.html index.htm;
allow all;
}
# DIR VSDESK
location /var/www/vsdesk2 {
allow all;
}
location @fallback {
rewrite ^(.*)$ /index.php?$args last;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
# Mitigate https://httpoxy.org/ vulnerabilities
fastcgi_param HTTP_PROXY "";
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
# include the fastcgi_param setting
include fastcgi_params;
# SCRIPT_FILENAME parameter is used for PHP FPM determining
# the script name. If it is not set in fastcgi_params file,
# i.e. /etc/nginx/fastcgi_params or in the parent contexts,
# please comment off following line:
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
И есть конфиг апача ОТ которого надо правильный nginx сделать
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName vsdesk
ServerAlias vsdesk.yourdomain.com
DocumentRoot /var/www/vsdesk
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/vsdesk/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
В nginx/error.log пишет
"/var/www/vsdesk2/index.php" is forbidden (13: Permission denied),
права на каталог 766, кто подскажет где у меня фейл:С
> права на каталог 766 это опечатка или на каталог действительно нет execute для group и others?
Обсуждают сегодня