server { listen *:80; server_name speaknfun.org.ua www.speaknfun.org.ua; access_log /var/log/nginx/speaker-access.log main; index index.php; root /home/.chroot/speaker; location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { log_not_found off; access_log off; } location ~ \..*/.*\.php$ { return 403; } location ~* Files/styles { access_log off; expires max; try_files $uri @rewrite; } location / { try_files $uri $uri/ @rewrite; expires max; } location @rewrite { rewrite ^/(.*)$ /index.php?q=$1; } location ~ \.php$ { fastcgi_pass unix:/var/tmp/php-fcgi.sock; include /etc/nginx/fastcgi-params.conf; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } }