NGINX

Augmenter la taille des post et des upload pour NGINX/PHP

  1. post_max_size
grep -ir post_max_size /etc/php5/fpm/*
# Output:
/etc/php5/fpm/php.ini:post_max_size = 16M
  1. client_max_body_size
grep -ir client_max_body_size /etc/nginx/*
# Output:
/etc/nginx/nginx.conf:                              client_max_body_size 16M;
/etc/nginx/sites-available/dev1.zone.example.com:    client_max_body_size    16M;

  1. upload_max_filesize
grep -ir upload_max_filesize /etc/php5/*
# Output:
fpm/php.ini:upload_max_filesize = 10M
  1. Reload des services
service php-fpm reload
service nginx reload

Add a module

apt-get install php5-imap
php5enmod imap
#ln -s ../../mods-available/imap.ini 20-imap.ini
service php5-fpm restart
service nginx restart

Afficher le status/informations d'un site

  1. Configurer php-fpm vim /etc/php5/fpm/pool.d/wwww.conf :
  ; Default Value: not set
  pm.status_path = /status  #<- Décommenter cette ligne.
  1. Vérifier la config :
  php5-fpm -t
  1. Redémarrer le service :
  service php5-fpm restart
  1. Ajouter dans la config ngninx de votre site vim /etc/nginx/sites-available/www.site.com:
  location ~ ^/(status|ping)$ {
    allow 10.25.7.0/24;
    allow 127.0.0.1;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_pass   127.0.0.1:9013;
  }
  1. Vérifier la config :
  nginx -t
  1. Redémarrer le service ngninx :
  service nginx restart

Default log format

$remote_addr - $remote_user - [$time_local] "$request" $status $bytes_sent "$http_referer" "$http_user_agent" "$gzip_ratio"