Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Listen unix socket
- To: nginx-ru@xxxxxxxxx
- Subject: Listen unix socket
- From: Александр Сытар <sytar.alex@xxxxxxxxx>
- Date: Sat, 27 Feb 2010 11:51:56 +0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=6LOfJAWn1wMGl9viL9WiazhnEmPMjJ9q54itTOpdQN0=; b=EaG4siSOVahN8zEid4e3gIjrLzzIuLj2zs6HMq8utp57r0czjFdELN53iWboVTHr2l c0+xvDK4MDhlwoAa8ueImtERqrX3dhR4EpxC6ghc1zrfmVGFHXmME5jpyPpgSDyYFaq3 73RiFca1nsskrinwmPK4MwcKc2gtbeqS2dDBs=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; b=Mnt/uI27mbZxnqPtPVWioLqYLo61KmnBzBg0pzwSIKxcherZo1eI4qXOHkZrCeVv/2 GbetcxY3MYDm1kp74JK1bI5tXa5BubjexCd37J7XZhJxedFc+RUkPTUm5ApH4anKPGXr UwSJ2zmVjb0m6cq/JrWESnyogJ9g6emgLnJV4=
Хочется странного - слушать unix socket. Попробовал в лоб:
## images server
server {
listen unix:/var/lib/nginx/backend.socket:;
access_log off;
error_log logs/images.error.log warn;
root /usr/share/nginx/www_images;
keepalive_timeout 0;
location /images/small {
alias /usr/share/nginx/www_images;
image_filter resize 200 200;
error_page 415 = @empty;
}
location /images {
alias /usr/share/nginx/www_images;
image_filter resize 500 500;
error_page 415 = @empty;
}
location @empty {
empty_gif;
}
}
### end
Чтобы потом его спроксировать в www
## WWW main server
server {
listen ip:port;
server_name some_name;
location /images/small {
access_log off;
proxy_pass
http://unix:/var/lib/nginx/backend.socket:;
proxy_cache image-preview;
proxy_cache_key "$host$document_uri";
proxy_cache_valid 200 30d;
expires 30d;
gzip_proxied expired no-cache no-store private auth;
add_header Cache-Control private;
proxy_ignore_client_abort off;
}
location /images {
access_log off;
proxy_pass
http://unix:/var/lib/nginx/backend.socket:;
proxy_cache image-preview;
proxy_cache_key "$host$document_uri";
proxy_cache_valid 200 30d;
expires 30d;
add_header Cache-Control private;
gzip_proxied expired no-cache no-store private auth;
proxy_ignore_client_abort off;
}
}
### end
Тест говорит что конфигурация - ок, при релаоде сокет создаётся,
однако в логах появляется
2010/02/27 11:28:37 [notice] 14327#0: signal process started
2010/02/27 11:28:45 [emerg] 15407#0: bind() to failed (98: Address
already in use)
2010/02/27 11:28:45 [emerg] 15407#0: bind() to failed (98: Address
already in use)
2010/02/27 11:28:45 [emerg] 15407#0: bind() to failed (98: Address
already in use)
2010/02/27 11:28:45 [emerg] 15407#0: bind() to failed (98: Address
already in use)
2010/02/27 11:28:45 [emerg] 15407#0: bind() to failed (98: Address
already in use)
2010/02/27 11:28:45 [emerg] 15407#0: still could not bind()
2010/02/27 11:29:02 [emerg] 15533#0: bind() to failed (98: Address
already in use)
2010/02/27 11:29:02 [emerg] 15533#0: bind() to failed (98: Address
already in use)
2010/02/27 11:29:02 [emerg] 15533#0: bind() to failed (98: Address
already in use)
2010/02/27 11:29:02 [emerg] 15533#0: bind() to failed (98: Address
already in use)
2010/02/27 11:29:02 [emerg] 15533#0: bind() to failed (98: Address
already in use)
2010/02/27 11:29:02 [emerg] 15533#0: still could not bind()
# nginx -V
nginx version: nginx/0.7.65
configure arguments: --with-cc-opt='-O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables' --user=nginx --group=nginx
--prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx
--conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log
--http-client-body-temp-path=/var/lib/nginx/tmp/client_body
--http-proxy-temp-path=/var/lib/nginx/tmp/proxy
--http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi
--pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx
--with-http_flv_module --with-http_stub_status_module
--with-http_geoip_module --with-http_image_filter_module --with-debug
--with-rtsig_module --without-http_memcached_module --with-mail
--without-http_ssi_module --without-http_autoindex_module
--without-http_referer_module --without-http_memcached_module
--without-http_limit_zone_module --without-http_limit_req_module
--with-http_gzip_static_module
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru
|