-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nginx: JSON config and reload production-ready
* make emailACME optional in json config * enableACME is activated automatically if one of forceSSL, onlySSL or addSSL is set to true. * JSON config can be now be split into multiple files * merge all snippets into a single set * prevents and reports duplicate vhost names * use nginx reload code from upstream PR NixOS/nixpkgs#24476 * our reload code is superseded by the changes in nixpkgs * reloading on fc-manage now works for json config * changes to *.conf are picked up after systemctl reload nginx * add nginx config helper commands * nginx-show-config shows the currently activated nginx config * nginx-check-config runs nginx -t for the current config * update readme, json config is preferred now * include modified nginx test from nixpkgs Case 110209
- Loading branch information
Showing
7 changed files
with
124 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ lib, ...}: | ||
|
||
with lib; | ||
|
||
rec { | ||
# Returns a list of attribute names that appear in more than one attrset. | ||
# Useful for checking if merging the attrsets would overwrite a previous value. | ||
# | ||
# duplicateAttrNames [ { a = 1; } { b = 2; } { a = 3; } ] | ||
# => [ "a" ] | ||
duplicateAttrNames = listOfAttrs: | ||
attrNames | ||
(filterAttrs | ||
(n: a: a > 1) | ||
(foldAttrs | ||
(n: acc: acc + 1) | ||
0 | ||
listOfAttrs)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters