Skip to content

Conversation

@fullyint
Copy link
Contributor

Multiple listen directives

It appears Ubuntu doesn't support dual-stack sockets (single socket serving both IPv4 and IPv6), even with ipv6only=off parameter for listen. Separate listen directives are necessary for no-default.conf to serve IPv4 and IPv6 connections to unknown hosts. Discussion at h5bp/server-configs-nginx#179 (comment).

deferred parameter

This PR also adds the deferred parameter to enable deferred accept() (the TCP_DEFER_ACCEPT socket option) to streamline usage of server processes. Here is the best description I found.

Note that deferred is one of the "additional parameters ... [that can be applied] only once for a given address:port pair" (Nginx docs). For this reason it should be applied only in the no-default.conf. If deferred were also applied for WordPress vhosts, Nginx would fail to reload: nginx: [emerg] duplicate listen options for socket (example discussion).

Testing IPv6

Of course, to test IPv6, one's local machine and server must both enable IPv6. For Trellis to make IPv6 SSH connections (e.g., to run a playbook), adjust the ListenAdresses and AddressFamily:

 sshd_listen_addresses:
   - 0.0.0.0
+  - '::'

-sshd_address_family: inet
+sshd_address_family: any

⚠️ Trellis is not ready for IPv6 in production. There are no ip6tables settings.

Ubuntu doesn't appear to support dual-stack sockets, even if
ipv6only=off is added. Separate listen directives are necessary for
no-default.conf to serve IPv4 and IPv6 connections to unknown hosts.
Enable deferred accept() (the TCP_DEFER_ACCEPT socket option) to
streamline usage of server processes.
@tangrufus
Copy link
Member

Can we apply the same patch to ssl.no-default as well? That file is currently ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants