user www-data; worker_processes 1; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 512; } http { include /etc/nginx/mime.types; default_type application/octet-stream; proxy_temp_path /tmp/nginx/; client_body_temp_path /tmp/nginx/; access_log /var/log/nginx/access.log; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; tcp_nodelay on; gzip on; gzip_proxied expired no-cache no-store private auth; server { listen lug-mgn.ru:80; server_name www.lug-mgn.ru lug-mgn.ru; charset utf-8; # ........ location / { root /var/www/lug/; index index.php index.html index.htm; if (!-e $request_filename ) { rewrite ^(.*)$ /index.php?q=$1; } } # redirect server error pages to the static page /50x.html error_page 500 502 503 504 /50x.html; location = /50x.html { root /var/www/nginx-default; } location ~ .php$ { fastcgi_pass unix:/var/www/php-fastcgi.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/lug$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one location ~ /\.ht { deny all; } } }