1# `_utils.mkNginxFile`
2`{filename<str> ? "index.html", content<str>, status<int> ? 200} -> {alias<str>, tryFiles<str>}`
3
4Helper function to generate an attrset compatible with a nginx vhost `locations` attribute that serves a single file.
5
6## Example
7
8### Without filename
9```nix
10services.nginx.virtualHosts."example.com".locations."/" = _utils.mkNginxFile {
11 content = ''
12 <!doctype html><html><body>We've been trying to reach you about your car's Extended Warranty.</body></html>
13 '';
14};
15```
16
17### With filename
18```nix
19services.nginx.virtualHosts."filename.example.com".locations."/filename" = _utils.mkNginxFile {
20 content = "the filename doesn't really matter, but it's there to help you figure out where your things are";
21 filename = "random.txt";
22}
23```