Linux Harbour

Technology News of Linux & Open Source

Linux

WordPress and Nginx with PHP-FPM

When I installs wordpress running on nginx with php-fpm, I will add the following config lines at nginx virtual host setting to allow static files (image files, document files, etc.) to bypass php-fpm.

location / {
    try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~* ^.+\.(jpg|jpeg|gif|png|css|zip|pdf|txt|js|flv|swf|html|htm)$        {
    #
}
client_max_body_size 64M;

And adding the following PHP custom settings to allow large file uploading.

memory_limit = 128M
upload_max_filesize = 64M
post_max_size = 64M

Above settings can be also used at ISPConfig 3.

Sammy Fung

Sammy is the founder of the Linux Harbour.