parent
2ae1dc3031
commit
17402e4bef
|
@ -254,6 +254,30 @@ in
|
|||
%nasp ALL = (root) NOPASSWD: /run/current-system/sw/bin/shutdown
|
||||
%nasp ALL = (root) NOPASSWD: /run/current-system/sw/bin/ip
|
||||
'';
|
||||
## nginx
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts."default" = {
|
||||
serverName = "_";
|
||||
default = true;
|
||||
locations."/" = {
|
||||
return = "404";
|
||||
};
|
||||
};
|
||||
virtualHosts."code-server" = {
|
||||
serverName = "proxy.nasp.fit";
|
||||
locations."~ ^/${config.networking.hostName}/([A-Za-z0-9]+)/(.*)" = {
|
||||
extraConfig = ''
|
||||
rewrite "^/${config.networking.hostName}/([A-Za-z0-9]+)/(.*)" /$2 break;
|
||||
proxy_pass "http://unix:/home2/run/$1.sock";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection upgrade;
|
||||
proxy_set_header Accept-Encoding gzip;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}))
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -79,6 +79,9 @@ if [[ "$ret" == "1" ]]; then
|
|||
eval "$base_command"
|
||||
echo "Container $container_name started. You can use the following command to get in:"
|
||||
echo "sudo docker exec -it $container_name bash"
|
||||
if [[ "$image_name" == "git.nasp.fit/nasp/nasp-ubuntu" ]]; then
|
||||
sudo docker exec -it $container_name code.sh
|
||||
fi
|
||||
else
|
||||
echo "Aborted."
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue
Block a user