server {
listen #IP#:80;
server_name #DOMAIN#.ru www.#DOMAIN#.ru;
access_log /var/log/nginx/production/#PRE_DOMAIN#.log def;
location / {
proxy_pass http://#DEST-IP#:80;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 128 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ /\.ht {
deny all;
}
}
server {
listen #IP#:8081;
server_name #DOMAIN#.ru www.#DOMAIN#.ru;
access_log /var/log/nginx/def/#PRE_DOMAIN#.log def;
root /usr/home/#PRE_DOMAIN#/def/;
{опущены некоторые rewrite правила}
location /kcaptcha/ {
proxy_pass http://#LOCAL-IP#:8080/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_body_temp_path /var/tmp/nginx/client_body_temp;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 75;
proxy_send_timeout 180;
proxy_read_timeout 180;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}
и вот конфиг дефолтного виртуального сервера
server {
listen 80 default accept_filter=httpready;
root /usr/local/etc/nginx/default_vhost/;
rewrite ^/(.*)$ /index.html break;
index index.html;
}
основной конфиг
user www;
worker_processes 1;
error_log /var/log/nginx/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 200000;
}
http {
open_file_cache max=1000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
server_tokens off;
client_max_body_size 15m;
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
log_format def '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'$request_time ' '$connection';
access_log /var/log/nginx/access.log def;
sendfile on;
tcp_nopush on;
#output_buffers 1 32k;
postpone_output 1460;
keepalive_timeout 65;
reset_timedout_connection on;
#gzip on;
include vhosts/*.conf;
}
Спасибо.