<p dir="ltr">Hi Charles,</p>
<p dir="ltr">IPv6 listeners can also accept IPv4 requests. This will result in IPs being passed through to logs and such like ::ffff:192.168.123.101. If you do not want this and do want both, add ipv6only=on to the IPv6 listen line.</p>
<p dir="ltr">Daniël</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Jul 26, 2016 02:25, "Charles Lawrence" <<a href="mailto:geuis.teses@gmail.com">geuis.teses@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm in the process of setting up a new server built on ubuntu 16.04<br>
using nginx 1.10.0.<br>
<br>
The specific issue is that while my new configuration essentially<br>
matches my old nginx configuration from an ubuntu 13.10 server using<br>
nginx 1.4.4, nginx 1.10.0 is only creating either ipv4 or ipv6<br>
workers, but not both. This behavior is not present on the old server.<br>
Not sure what else to try at this point.<br>
<br>
I've verified that my nginx installation was built with ipv6.<br>
<br>
> nginx version: nginx/1.10.0 (Ubuntu)<br>
> built with OpenSSL 1.0.2g-fips 1 Mar 2016<br>
> TLS SNI support enabled<br>
> configure arguments: --with-cc-opt='-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_v2_module --with-htt<br>
p_sub_module --with-http_xslt_module --with-stream --with-stream_ssl_module --with-mail --with-mail_ssl_module --with-threads<br>
<br>
Below are my current configurations for the new server:<br>
<br>
># /etc/nginx/nginx.conf> user www-data;<br>
> worker_rlimit_nofile 30000;<br>
> worker_processes 8;<br>
> pid /run/nginx.pid;<br>
><br>
> events {<br>
> worker_connections 500000;<br>
> }<br>
><br>
> http {<br>
> sendfile on;<br>
> tcp_nopush on;<br>
> tcp_nodelay on;<br>
> keepalive_timeout 65;<br>
> types_hash_max_size 2048;<br>
><br>
> include /etc/nginx/mime.types;<br>
> default_type application/octet-stream;<br>
><br>
> ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE<br>
> ssl_prefer_server_ciphers on;<br>
><br>
> access_log /var/log/nginx/access.log;<br>
> error_log /var/log/nginx/error.log;<br>
><br>
> gzip on;<br>
> gzip_disable "msie6";<br>
> gzip_vary on;<br>
> gzip_proxied any;<br>
> gzip_comp_level 6;<br>
> gzip_buffers 16 8k;<br>
> gzip_http_version 1.1;<br>
> gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;<br>
><br>
> include /etc/nginx/conf.d/*.conf;<br>
> include /etc/nginx/sites-enabled/*;<br>
> }<br>
<br>
Lastly, the weird thing is whether the workers get bound to ipv4 or<br>
ipv6 entirely depends on the order in which the listen directives are<br>
placed. In the following data, I've switched the order and tried<br>
different configurations multiple times. After each change to<br>
/etc/nginx/sites-enabled/blog I did sudo service nginx stop; sudo<br>
service nginx start; sudo lsof -i;to get the data.<br>
<br>
Also note that I changed the workers count to 8 after performing these<br>
steps. However while the number of workers increased, the same<br>
behavior was seen where all workers were either ipv4 or ipv6.<br>
<br>
> listen [::]:80;<br>
> listen 80;<br>
> nginx 27675 root 6u IPv4 204423 0t0 TCP *:http (LISTEN)<br>
> nginx 27676 www-data 6u IPv4 204423 0t0 TCP *:http (LISTEN)<br>
><br>
> listen 80;<br>
> listen [::]:80;<br>
> nginx 27747 root 6u IPv6 205134 0t0 TCP *:http (LISTEN)<br>
> nginx 27748 www-data 6u IPv6 205134 0t0 TCP *:http (LISTEN)<br>
><br>
> listen 80;<br>
> listen [::]:80 default ipv6only=on;<br>
> nginx 27819 root 6u IPv6 205849 0t0 TCP *:http (LISTEN)<br>
> nginx 27820 www-data 6u IPv6 205849 0t0 TCP *:http (LISTEN)<br>
><br>
> listen 80;<br>
> listen [::]:80 default ipv6only=off;<br>
> nginx 27885 root 6u IPv6 206495 0t0 TCP *:http (LISTEN)<br>
> nginx 27886 www-data 6u IPv6 206495 0t0 TCP *:http (LISTEN)<br>
><br>
> listen 80;<br>
> listen [::]:80 default;<br>
> nginx 27953 root 6u IPv6 207184 0t0 TCP *:http (LISTEN)<br>
> nginx 27954 www-data 6u IPv6 207184 0t0 TCP *:http (LISTEN)<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div></div>