nginx: Use openresty package. Add openidc plugin.

This commit is contained in:
Giulio De Pasquale 2022-10-28 13:40:50 +02:00
parent 9a2c8886ed
commit dddc557b46

View File

@ -1,8 +1,9 @@
{ services, ... }:
{ services, pkgs, lib, ... }:
{
services.nginx = {
enable = true;
package = pkgs.openresty;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
@ -25,6 +26,17 @@
"/wat.jpg" = { };
};
};
appendHttpConfig = let
extraPureLuaPackages = with pkgs.luajitPackages; [ lua-resty-openidc ];
luaPath = pkg: "${pkg}/share/lua/5.1/?.lua";
makeLuaPath = lib.concatMapStringsSep ";" luaPath;
in ''
lua_package_path '${makeLuaPath extraPureLuaPackages};;';
# cache for OIDC discovery metadata
lua_shared_dict discovery 1m;
'';
appendConfig = ''
worker_processes 24;
'';