php-fpm chroot config

nano /etc/php5/fpm/pool.d/maxi.conf

[maxi]


listen = 127.0.0.1:9001

listen.allowed_clients = 127.0.0.1

user = maxi
group = maxi

pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

prefix = /home/maxi/webspace
chroot = $prefix

chdir = /

 

nano /etc/nginx/sites-available/maxi

server {
    listen 80;
    server_name maxi.mattionline.de;
    access_log /var/log/nginx/access.log combined;
    error_log  /var/log/nginx/error.log;

    root /home/maxi/webspace;
    index index.html index.htm index.php;

location ~ \.(php)$ {
        fastcgi_keep_conn on;
        fastcgi_pass 127.0.0.1:9001;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
        include fastcgi_params;
}

location ~* \.(jpg|jpeg|gif|css|png|js|ico) {
        expires         30d;
        access_log      off;
        log_not_found   off;
}

    autoindex on;
}

#troubleshooting

FastCGI sent in stderr: „Primary script unknown“ while reading response header from upstream

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; ändern zu

fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;

 

  •  
  •  
  •  
  •  

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.