nginx php-fpm keeps downloading files
- by Sam Williams
vhost:
server {
listen *:8080;
location / {
root /var/www/default/pub;
index index.php;
# if file exists return it right away
if (-f $request_filename) {
break;
}
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php$1 last;
break;
}
}
# serve static files directly
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
access_log off;
expires max;
}
location ~* \.php$ {
# By all means use a different server for the fcgi processes if you need to
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include /usr/local/nginx/conf/fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
http://192.168.135.128/index.php loads just fine...
http://192.168.135.128/public_/html/index.php downloads...