Welcome! Log In Create A New Profile

Advanced

Listen unix socket

Александр Сытар
February 27, 2010 03:54AM
Хочется странного - слушать 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@nginx.org
http://nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

Listen unix socket

Александр Сытар February 27, 2010 03:54AM

Re: Listen unix socket

Maxim Dounin February 27, 2010 04:30AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 136
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready