about summary refs log tree commit diff
path: root/modules/server/nginx/default.nix
blob: 2344197bcff66bd16e885b3dd2869ec65290cffc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{ pkgs, ... }:

{
  services.fcgiwrap.enable = true;

  services.nginx.enable = true;
  services.nginx.package = pkgs.nginxMainline;

  services.nginx.recommendedOptimisation = true;
  services.nginx.recommendedTlsSettings = true;
  services.nginx.recommendedGzipSettings = true;
  services.nginx.recommendedProxySettings = true;

  services.nginx.commonHttpConfig = ''
    log_format privacy '[$time_local] $request_method '
                       '$scheme://$host$request_uri $status $body_bytes_sent';

    # systemd catches syslog, and access_log doesn't support stdout/stderr.
    access_log syslog:server=unix:/dev/log privacy;
  '';
}