Welcome! Log In Create A New Profile

Advanced

[PATCH] Mail: fix support for unix sockets in auth_http

Maxim Dounin
December 23, 2009 07:52PM
# HG changeset patch
# User Maxim Dounin <mdounin@mdounin.ru>
# Date 1261615729 -10800
# Node ID c72fabe04c8d51c5d9f972aaeee1b1644d4c8ac1
# Parent 6026569dbf6419fdfef3dd31b76d6898ee3bbb17
Mail: fix support for unix sockets in auth_http.

Requests to auth_http server were produced with incorrect Host header and
as a result were rejected at least by nginx's own http server. Use localhost
as Host header for unix sockets (consistent with http proxy module).

Reported by: Alexey V. Degtyarev

diff --git a/src/mail/ngx_mail_auth_http_module.c b/src/mail/ngx_mail_auth_http_module.c
--- a/src/mail/ngx_mail_auth_http_module.c
+++ b/src/mail/ngx_mail_auth_http_module.c
@@ -1405,7 +1405,14 @@ ngx_mail_auth_http(ngx_conf_t *cf, ngx_c

ahcf->peer = u.addrs;

- ahcf->host_header = u.host;
+ if (u.family != AF_UNIX) {
+ ahcf->host_header = u.host;
+
+ } else {
+ ahcf->host_header.len = sizeof("localhost") - 1;
+ ahcf->host_header.data = (u_char *) "localhost";
+ }
+
ahcf->uri = u.uri;

if (ahcf->uri.len == 0) {

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Mail: fix support for unix sockets in auth_http

Maxim Dounin 2690 December 23, 2009 07:52PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 90
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready