You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The option services.nginx.defaultListen maps into a nginx http->server section for each defined virtual host, but this transform always sets a value on the port attribute. The mapping code assumes the addr attribute is always of type AF_INET, while AF_UNIX is also possible.
Steps To Reproduce
The nixos module stub below results in the nginx configuration stub below. Note that a port is appended to the unix socket segment.
http {
server {
listen unix:/run/nginx/virtualhosts.sock:443 ssl default_server ; # <-- port is added here
server_name default ;
ssl_reject_handshake on;
location / {
return 404;
}
}
}
Expected behavior
The mapping code should not force a port if the addr has prefix unix:.
If port attribute remains at null, the port will not be written out to the nginx configuration, effectively omitting the ":443" from the above snippet
A workaround is setting the listen configuration manually on each virtual host attribute set.
As mentioned above, the nginx configuration printer already handles an unset port correctly.
Describe the bug
The option
services.nginx.defaultListen
maps into a nginx http->server section for each defined virtual host, but this transform always sets a value on the port attribute. The mapping code assumes the addr attribute is always of type AF_INET, while AF_UNIX is also possible.Steps To Reproduce
The nixos module stub below results in the nginx configuration stub below. Note that a port is appended to the unix socket segment.
Expected behavior
The mapping code should not force a port if the addr has prefix
unix:
.If port attribute remains at null, the port will not be written out to the nginx configuration, effectively omitting the ":443" from the above snippet
Additional context
Code in question is here (I think)
nixpkgs/nixos/modules/services/web-servers/nginx/default.nix
Lines 304 to 314 in 6df2492
Metadata
Notify maintainers
No meta tag or maintainers reference, so falling back to;
Note for maintainers: Please tag this issue in your PR.
Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: