Added units

This commit is contained in:
Stephen Cochrane 2020-10-15 09:44:10 +02:00
parent 9d8fc96dbc
commit 3312e8e2a9
6 changed files with 67 additions and 3 deletions

10
nginxd
View File

@ -55,8 +55,12 @@ unitsd=${unitsd:="./units"}
# Check that a valid unit was given.
[[ ! " ${units[@]} " =~ " ${unit} " ]] && error "The unit <$unit> does not exist." 1 \
|| echo "Unit <$unit> found!"
|| echo "Unit <$unit> is supported!"
# Check if we are disabeling, that we have a replacement unit
[ $oper == "d" ] && [[ ! -f "$unitsd/d$unit" ]] && error "Cannot find replacement unit for <$unit>" 1
[ $oper == "e" ] && [[ ! -f "$unitsd/$unit" ]] && error "Cannot find unit file for <$unit>" 1
# Everything is valid, start setting up.
cp $unitsd/* /etc/nginx/sites-available/
# TODO: Setup links, and delete links if needed
#cp $unitsd/* /etc/nginx/sites-available/
echo TODO: Setup links, and delete links if needed

12
units/blog Normal file
View File

@ -0,0 +1,12 @@
server {
listen 80;
server_name blog.skiqqy.xyz;
location / {
proxy_pass http://localhost:84;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

12
units/git Normal file
View File

@ -0,0 +1,12 @@
server {
listen 80;
server_name git.skiqqy.xyz;
location / {
proxy_pass http://localhost:83;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

12
units/irc Normal file
View File

@ -0,0 +1,12 @@
server {
listen 80;
server_name irc.skiqqy.xyz;
location / {
proxy_pass http://localhost:81;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

12
units/proj Normal file
View File

@ -0,0 +1,12 @@
server {
listen 80;
server_name proj.skiqqy.xyz;
location / {
proxy_pass http://localhost:82;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

12
units/wiki Normal file
View File

@ -0,0 +1,12 @@
server {
listen 80;
server_name wiki.skiqqy.xyz;
location / {
proxy_pass http://localhost:85;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}