ubuntu - Nginx downloads 'download' file instead of executing PHP
one text
This is my configuration:
server {
listen 4343 default_server ssl http2;
listen [::]:4343 default_server ssl http2 ipv6only=on;
server_name mail.napegaming.eu;
root /var/www/roundcube/;
index index.php index.html index.htm;
ssl_certificate /etc/letsencrypt/live/mail.napegaming.eu/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mail.napegaming.eu/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
error_log /var/log/nginx/roundcube.error;
access_log /var/log/nginx/roundcube.access;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/run/php/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /.well-known/acme-challenge {
allow all;
}
location ~ ^/(README|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
deny all;
}
location ~ ^/(bin|SQL)/ {
deny all;
}
# A long browser cache lifetime can speed up repeat visits to your page
location ~* .(jpg|jpeg|gif|png|webp|svg|woff|woff2|ttf|css|js|ico|xml)$ {
access_log off;
log_not_found off;
expires 360d;
}
}
Everything works. When I enter website there is just 403 which is OK but when I enter /installer which should start installation of roundcube webmail it just downloads: 'download' file. When I open it there is code of index.php of roundcube installation folder.
SSL certificates are valid. php-fpm.sock is OK so I don't know where is the problem.
Source