Opened 7 years ago

Closed 7 years ago

#1400 closed defect (invalid)

test the configuration file failed in v1.12.2, but not in v1.12.1

Reported by: liying.cn.2010@… Owned by:
Priority: major Milestone:
Component: other Version: 1.12.x
Keywords: Cc:
uname -a: Linux hostname 2.6.32-696.1.1.el6.x86_64 #1 SMP Tue Apr 11 17:13:24 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.12.2
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'

Description

I upgraded to the latest v1.12.2, and when we test the configuration file, it failed with the following error message:

/usr/sbin/nginx -t -c /home/www/etc/nginx.conf
nginx: the configuration file /home/www/etc/nginx.conf syntax is ok
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: configuration file /home/www/etc/nginx.conf test failed

I runned this command using user "www", which has no permission to bind to port 80, I understand this part.

But in the old v1.12.1, same command can be executed with no error. This error only happen in the new v1.12.2
Looks like the new v1.12.2 trying to bind to the port even in the "test the configuration file" mode, but the old v1.12.1 didn't do this.

I looked at the source code, may be this change is the reason??
https://github.com/nginx/nginx/commit/cff518295514b19f2ac5db8bd887c2124845dea0


Change History (2)

comment:1 by liying.cn.2010@…, 7 years ago

Sorry, we found the real reason of this problem.
It was nothing wrong on the nginx side.
It was our ansible setting going wrong.

Sorry for the false alarm!!
Please close this ticket.

comment:2 by Sergey Kandaurov, 7 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.