mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 00:57:22 +01:00
refactor: cleaner nginx settings
This commit is contained in:
parent
057c7e9194
commit
266ad63ceb
9 changed files with 438 additions and 386 deletions
|
|
@ -1,28 +1,38 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
let
|
||||
serviceDomain = "servant.swarsel.win";
|
||||
servicePort = 8088;
|
||||
serviceName = "jenkins";
|
||||
in
|
||||
{
|
||||
options.swarselsystems.modules.server.jenkins = lib.mkEnableOption "enable jenkins on server";
|
||||
config = lib.mkIf config.swarselsystems.modules.server.jenkins {
|
||||
options.swarselsystems.modules.server."${serviceName}" = lib.mkEnableOption "enable ${serviceName} on server";
|
||||
config = lib.mkIf config.swarselsystems.modules.server."${serviceName}" {
|
||||
|
||||
services.jenkins = {
|
||||
enable = true;
|
||||
withCLI = true;
|
||||
port = 8088;
|
||||
packages = [ pkgs.stdenv pkgs.git pkgs.jdk17 config.programs.ssh.package pkgs.nix ];
|
||||
listenAddress = "127.0.0.1";
|
||||
listenAddress = "0.0.0.0";
|
||||
home = "/Vault/apps/jenkins";
|
||||
};
|
||||
|
||||
|
||||
|
||||
services.nginx = {
|
||||
upstreams = {
|
||||
"${serviceName}" = {
|
||||
servers = {
|
||||
"192.168.1.2:${builtins.toString servicePort}" = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
virtualHosts = {
|
||||
"servant.swarsel.win" = {
|
||||
"${serviceDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
acmeRoot = null;
|
||||
locations = {
|
||||
"/" = {
|
||||
proxyPass = "http://localhost:8088";
|
||||
proxyPass = "http://${serviceName}";
|
||||
extraConfig = ''
|
||||
client_max_body_size 0;
|
||||
'';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue