server { listen 80; server_name mail.domaine.com; root /var/www/; index index.php; location ^~ /data { deny all; } location ~ \.(js|css|png|jpg|jpeg|gif|ico|svg|woff)$ { expires 2M; add_header Cache-Control "public"; } access_log /var/log/nginx/mail.domaine.com.access; error_log /var/log/nginx/mail.domaine.com.error error; location ~ .php$ { try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }