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

http://ag-up.com
nginx.conf:

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

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

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/*;

}

conf.d/size_limits.conf:

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

conf.d/timeouts.conf:

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

sites-available/default:

server {
listen 80;
server_name 192.168.0.1;

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

location / {
gzip_static on;
root /var/www/nginx-default;
index index.php index.html index.htm;
allow 10.0.0.90;
allow 172.24.0.195;
allow 172.24.0.196;
allow 172.24.0.204;
deny all;
client_max_body_size 10m;
}

location = /stat {
stub_status on;
access_log off;
allow 10.0.0.90;
allow 172.24.0.195;
allow 172.24.0.196;
allow 172.24.0.204;
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 {
empty_gif;
}

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.

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

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

Логотип WordPress.com

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

Фотография Twitter

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

Фотография Facebook

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

Google+ photo

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

Connecting to %s

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