Nginx: легкая настройка.

user www-data www-data;
worker_processes 3;
timer_resolution 100ms;

error_log /var/log/nginx/error.log;
pid /var/run/;

events {
worker_connections 1024;
# multi_accept on;

http {
include /etc/nginx/mime.types;

access_log /var/log/nginx/access.log;

ignore_invalid_headers on;
limit_zone gulag $binary_remote_addr 1m;
recursive_error_pages on;
server_name_in_redirect off;
server_tokens off;

sendfile on;
tcp_nopush on;
reset_timedout_connection on;
tcp_nodelay on;

gzip on;
gzip_static on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
gzip_min_length 0;
gzip_buffers 64 8k;
gzip_comp_level 9;
gzip_http_version 1.1;
gzip_proxied any;
gzip_types text/plain application/xml application/x-javascript text/css image/x-icon image/bmp;
gzip_vary on;

open_file_cache max=100000 inactive=40s;
open_file_cache_valid 60s;
open_file_cache_min_uses 2;
open_file_cache_errors on;

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;



client_body_buffer_size 8k;
client_header_buffer_size 1k;
client_max_body_size 1k;
large_client_header_buffers 1 1k;


client_body_timeout 5;
client_header_timeout 5;
keepalive_timeout 5 5;
send_timeout 5


server {
listen 80;

access_log /var/log/nginx/localhost.access.log;

location / {
gzip_static on;
root /var/www/nginx-default;
index index.php index.html index.htm;
deny all;
client_max_body_size 10m;

location = /stat {
stub_status on;
access_log off;
deny all;

location ~ \.php$ {
fastcgi_intercept_errors on;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/nginx-default$fastcgi_script_name;
include fastcgi_params;

location /favicon.ico {

error_page 404 /404.html;
location /404.html {
root /var/www/;

if ($request_method !~ ^(GET|POST)$ ) {
return 444;


  1. This website submit is really helpfull, i do believe i will far better if i bookmark this great site straight away

  2. Hey there, You have done an excellent job. I will certainly digg
    it and personally suggest to my friends. I am confident
    they will be benefited from this web site.

  3. Hiya very cool blog!! Man .. Beautiful .. Amazing .
    . I will bookmark your site and take the feeds also? I am glad to find so
    many useful info here in the publish, we need work out extra techniques in this regard, thanks for sharing.
    . . . . .

  4. Hi there! This blog post could not be written any better! Looking through this article reminds me of my previous roommate!
    He always kept preaching about this. I most certainly will forward
    this post to him. Fairly certain he’ll have a good read. Thanks for sharing!

  1. No trackbacks yet.

Добавить комментарий

Заполните поля или щелкните по значку, чтобы оставить свой комментарий:


Для комментария используется ваша учётная запись Выход / Изменить )

Фотография Twitter

Для комментария используется ваша учётная запись Twitter. Выход / Изменить )

Фотография Facebook

Для комментария используется ваша учётная запись Facebook. Выход / Изменить )

Google+ photo

Для комментария используется ваша учётная запись Google+. Выход / Изменить )

Connecting to %s

%d такие блоггеры, как: