forked from
lass.pds.lassul.us/superconfig
This repository has no description
1.5 kB
46 lines
1{ pkgs, ... }:
2{
3 services.nginx.virtualHosts."radio.lassul.us" = {
4 enableACME = true;
5 addSSL = true;
6 locations."/" = {
7 # recommendedProxySettings = true;
8 proxyWebsockets = true;
9 proxyPass = "http://radio.r";
10 extraConfig = ''
11 proxy_set_header Host radio.r;
12 # get source ip for weather reports
13 proxy_set_header user-agent "$http_user_agent; client-ip=$remote_addr";
14 '';
15 };
16 locations."/wish" = {
17 # recommendedProxySettings = true;
18 proxyWebsockets = true;
19 proxyPass = "http://radio.r:8002/wish";
20 extraConfig = ''
21 proxy_set_header Host radio.r;
22 # get source ip for weather reports
23 proxy_set_header user-agent "$http_user_agent; client-ip=$remote_addr";
24 '';
25 };
26 locations."/all_tracks" = {
27 # recommendedProxySettings = true;
28 proxyWebsockets = true;
29 proxyPass = "http://radio.r:8002/all_tracks";
30 extraConfig = ''
31 proxy_set_header Host radio.r;
32 # get source ip for weather reports
33 proxy_set_header user-agent "$http_user_agent; client-ip=$remote_addr";
34 '';
35 };
36 };
37 krebs.htgen.radio-redirect = {
38 port = 8000;
39 scriptFile = pkgs.writers.writeDash "redir" ''
40 printf 'HTTP/1.1 301 Moved Permanently\r\n'
41 printf "Location: http://radio.lassul.us''${Request_URI}\r\n"
42 printf '\r\n'
43 '';
44 };
45 networking.firewall.allowedTCPPorts = [ 8000 ];
46}