proxy formatting
This commit is contained in:
parent
28464391dc
commit
2afb0b0aae
1 changed files with 117 additions and 76 deletions
|
|
@ -7,6 +7,7 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
./hetzner-disk.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
|
|
@ -36,17 +37,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services =
|
||||||
openssh = {
|
|
||||||
enable = true;
|
|
||||||
listenAddresses = [
|
|
||||||
{
|
|
||||||
addr = "141.56.51.1";
|
|
||||||
port = 1005;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
haproxy =
|
|
||||||
let
|
let
|
||||||
forwards = {
|
forwards = {
|
||||||
plone = {
|
plone = {
|
||||||
|
|
@ -110,14 +101,64 @@
|
||||||
httpsPort = 443;
|
httpsPort = 443;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
indexPage = pkgs.writeTextFile {
|
||||||
|
name = "index.html";
|
||||||
|
text = ''
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>
|
||||||
|
StuRa HTWD Index
|
||||||
|
|
||||||
|
</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<ul>
|
||||||
|
${lib.foldlAttrs (
|
||||||
|
prev: name: value:
|
||||||
|
prev
|
||||||
|
+ ''
|
||||||
|
<li><a href="https://${value.domain}">${name}</a></li>
|
||||||
|
''
|
||||||
|
) "" forwards}
|
||||||
|
</ul>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
'';
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
openssh = {
|
||||||
|
enable = true;
|
||||||
|
listenAddresses = [
|
||||||
|
{
|
||||||
|
addr = "141.56.51.1";
|
||||||
|
port = 1005;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
nginx = {
|
||||||
|
enable = true;
|
||||||
|
virtualHosts."localhost" = {
|
||||||
|
listen = [
|
||||||
|
{
|
||||||
|
addr = "127.0.0.1";
|
||||||
|
port = 6942;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
locations."/" = {
|
||||||
|
extraConfig = ''
|
||||||
|
try_files ${indexPage} =404;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
haproxy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = ''
|
config = ''
|
||||||
global
|
global
|
||||||
log /dev/log format raw local0
|
log /dev/log format raw local0
|
||||||
maxconn 50000
|
maxconn 50000
|
||||||
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
|
#stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
|
||||||
tune.bufsize 32762
|
tune.bufsize 32762
|
||||||
|
|
||||||
defaults
|
defaults
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue