mirror of
https://github.com/archtechx/nix.git
synced 2025-12-12 03:24:02 +00:00
Add catchall.nix
This commit is contained in:
parent
ecf65b125d
commit
b091a51ec0
2 changed files with 14 additions and 0 deletions
|
|
@ -190,6 +190,13 @@ matching the site's `ssl` config.
|
||||||
Out of the box, if nginx cannot match an incoming request's host to a specific virtual host it will
|
Out of the box, if nginx cannot match an incoming request's host to a specific virtual host it will
|
||||||
just use _some_ vhost. You can prevent behavior that by adding a module like this:
|
just use _some_ vhost. You can prevent behavior that by adding a module like this:
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> You can also use the `catchall.nix` module here (which includes the code below):
|
||||||
|
>
|
||||||
|
> `scp catchall.nix root@<server ip>:/etc/nixos/`
|
||||||
|
>
|
||||||
|
> Then just add `./catchall.nix` to your modules array.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
services.nginx.virtualHosts."catchall" = {
|
services.nginx.virtualHosts."catchall" = {
|
||||||
|
|
|
||||||
7
catchall.nix
Normal file
7
catchall.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
services.nginx.virtualHosts."catchall" = {
|
||||||
|
default = true;
|
||||||
|
locations."/".return = "444";
|
||||||
|
rejectSSL = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue