mirror of
https://github.com/deltathetawastaken/dotfiles.git
synced 2025-12-06 07:16:37 +03:00
use redir instead of nginx
This commit is contained in:
parent
cee2108556
commit
f0b532ef5b
|
|
@ -62,36 +62,30 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.enable = true;
|
systemd.services.grafanaforward_43 = {
|
||||||
services.nginx.virtualHosts."grafana_first" = {
|
enable = true;
|
||||||
forceSSL = false;
|
description = "grafana forward";
|
||||||
listen = [{port = 1000; addr="0.0.0.0"; ssl=false;}];
|
wantedBy = [ "multi-user.target" ];
|
||||||
locations."/".extraConfig = ''
|
serviceConfig = {
|
||||||
proxy_set_header Host $host;
|
Restart = "on-failure";
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
RestartSec = "15";
|
||||||
proxy_pass http://123.123.123.123:3000;
|
Type="simple";
|
||||||
'';
|
DynamicUser=true;
|
||||||
locations."/api/live/ws".extraConfig = ''
|
Exec="${pkgs.redir}/bin/redir -n 2000 123.123.123.123:3000";
|
||||||
proxy_pass http://123.123.123.123:3000;
|
};
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
services.nginx.virtualHosts."grafana_second" = {
|
|
||||||
forceSSL = false;
|
systemd.services.grafanaforward_44 = {
|
||||||
listen = [{port = 1001; addr="0.0.0.0"; ssl=false;}];
|
enable = true;
|
||||||
locations."/".extraConfig = ''
|
description = "grafana forward";
|
||||||
proxy_set_header Host $host;
|
wantedBy = [ "multi-user.target" ];
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
serviceConfig = {
|
||||||
proxy_pass http://123.123.123.123:3000;
|
Restart = "on-failure";
|
||||||
'';
|
RestartSec = "15";
|
||||||
locations."/api/live/ws".extraConfig = ''
|
Type="simple";
|
||||||
proxy_pass http://123.123.123.123:3000;
|
DynamicUser=true;
|
||||||
proxy_http_version 1.1;
|
Exec="${pkgs.redir}/bin/redir -n 2001 123.123.123.123:3000";
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
};
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
system.stateVersion = "22.11";
|
system.stateVersion = "22.11";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue