Split websocket stuff in separate .conf for Nginx
This commit is contained in:
parent
ecc2874033
commit
f11d151924
|
@ -62,6 +62,10 @@ else
|
||||||
fi
|
fi
|
||||||
cp console2web/console2web.py /usr/bin/console2web
|
cp console2web/console2web.py /usr/bin/console2web
|
||||||
|
|
||||||
|
# Deploy web interface stuff
|
||||||
|
"$(dirname "$0")"/scripts/deploy_monitoring.sh
|
||||||
|
"$(dirname "$0")"/scripts/deploy_webserver.sh
|
||||||
|
|
||||||
# Deploy the game servers
|
# Deploy the game servers
|
||||||
"$(dirname "$0")"/scripts/deploy_supertuxkart.sh
|
"$(dirname "$0")"/scripts/deploy_supertuxkart.sh
|
||||||
"$(dirname "$0")"/scripts/deploy_bzflag.sh
|
"$(dirname "$0")"/scripts/deploy_bzflag.sh
|
||||||
|
@ -75,9 +79,5 @@ cp console2web/console2web.py /usr/bin/console2web
|
||||||
"$(dirname "$0")"/scripts/deploy_xonotic.sh
|
"$(dirname "$0")"/scripts/deploy_xonotic.sh
|
||||||
"$(dirname "$0")"/scripts/deploy_armagetron_advanced.sh
|
"$(dirname "$0")"/scripts/deploy_armagetron_advanced.sh
|
||||||
|
|
||||||
# Deploy web interface stuff
|
|
||||||
"$(dirname "$0")"/scripts/deploy_monitoring.sh
|
|
||||||
"$(dirname "$0")"/scripts/deploy_webserver.sh
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Installation complete. Password is ${systempassword}"
|
echo "Installation complete. Password is ${systempassword}"
|
||||||
|
|
|
@ -26,5 +26,15 @@ EOF
|
||||||
|
|
||||||
systemctl restart armagetronad-dedicated.service
|
systemctl restart armagetronad-dedicated.service
|
||||||
|
|
||||||
|
cat > /etc/nginx/gameserver.d/armagetronad.conf <<EOF
|
||||||
|
location /armagetronad {
|
||||||
|
proxy_pass http://localhost:62551/;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade \$http_upgrade;
|
||||||
|
proxy_set_header Connection "Upgrade";
|
||||||
|
proxy_set_header Host \$host;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
# Add firewall rules
|
# Add firewall rules
|
||||||
firewall-cmd --zone=public --add-port=4534/udp --permanent
|
firewall-cmd --zone=public --add-port=4534/udp --permanent
|
||||||
|
|
|
@ -29,5 +29,15 @@ EOF
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable --now mindustry.service
|
systemctl enable --now mindustry.service
|
||||||
|
|
||||||
|
cat > /etc/nginx/gameserver.d/mindustry.conf <<EOF
|
||||||
|
location /mindustry {
|
||||||
|
proxy_pass http://localhost:62548/;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade \$http_upgrade;
|
||||||
|
proxy_set_header Connection "Upgrade";
|
||||||
|
proxy_set_header Host \$host;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
firewall-cmd --zone=public --add-port=6567/tcp --permanent
|
firewall-cmd --zone=public --add-port=6567/tcp --permanent
|
||||||
firewall-cmd --zone=public --add-port=6567/udp --permanent
|
firewall-cmd --zone=public --add-port=6567/udp --permanent
|
||||||
|
|
|
@ -51,4 +51,14 @@ EOF
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable --now unvanquished.service
|
systemctl enable --now unvanquished.service
|
||||||
|
|
||||||
|
cat > /etc/nginx/gameserver.d/unvanquished.conf <<EOF
|
||||||
|
location /unvanquished {
|
||||||
|
proxy_pass http://localhost:62549/;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade \$http_upgrade;
|
||||||
|
proxy_set_header Connection "Upgrade";
|
||||||
|
proxy_set_header Host \$host;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
firewall-cmd --zone=public --add-port=27960/udp --permanent
|
firewall-cmd --zone=public --add-port=27960/udp --permanent
|
||||||
|
|
|
@ -45,7 +45,7 @@ patch --ignore-whitespace /etc/nginx/sites-available/default <<EOF
|
||||||
# Default server configuration
|
# Default server configuration
|
||||||
#
|
#
|
||||||
server {
|
server {
|
||||||
@@ -121,6 +126,39 @@
|
@@ -121,6 +126,17 @@
|
||||||
try_files \$uri \$uri/ =404;
|
try_files \$uri \$uri/ =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,29 +54,7 @@ patch --ignore-whitespace /etc/nginx/sites-available/default <<EOF
|
||||||
+ auth_basic_user_file /etc/nginx/htpasswd;
|
+ auth_basic_user_file /etc/nginx/htpasswd;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ location /mindustry {
|
+ include /etc/nginx/gameserver.d/*.conf;
|
||||||
+ proxy_pass http://localhost:62548/;
|
|
||||||
+ proxy_http_version 1.1;
|
|
||||||
+ proxy_set_header Upgrade \$http_upgrade;
|
|
||||||
+ proxy_set_header Connection "Upgrade";
|
|
||||||
+ proxy_set_header Host \$host;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ location /unvanquished {
|
|
||||||
+ proxy_pass http://localhost:62549/;
|
|
||||||
+ proxy_http_version 1.1;
|
|
||||||
+ proxy_set_header Upgrade \$http_upgrade;
|
|
||||||
+ proxy_set_header Connection "Upgrade";
|
|
||||||
+ proxy_set_header Host \$host;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ location /xonotic {
|
|
||||||
+ proxy_pass http://localhost:62550/;
|
|
||||||
+ proxy_http_version 1.1;
|
|
||||||
+ proxy_set_header Upgrade \$http_upgrade;
|
|
||||||
+ proxy_set_header Connection "Upgrade";
|
|
||||||
+ proxy_set_header Host \$host;
|
|
||||||
+ }
|
|
||||||
+
|
+
|
||||||
+ location /monitoring/ {
|
+ location /monitoring/ {
|
||||||
+ proxy_pass http://localhost:9000/;
|
+ proxy_pass http://localhost:9000/;
|
||||||
|
@ -87,6 +65,8 @@ patch --ignore-whitespace /etc/nginx/sites-available/default <<EOF
|
||||||
#location ~ \\.php\$ {
|
#location ~ \\.php\$ {
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
mkdir -p /etc/nginx/gameserver.d
|
||||||
|
|
||||||
# Store password
|
# Store password
|
||||||
echo -n "${systemuser}:" > /etc/nginx/htpasswd
|
echo -n "${systemuser}:" > /etc/nginx/htpasswd
|
||||||
echo -e "import bcrypt\nprint(bcrypt.hashpw('${systempassword}'.encode('utf8'),bcrypt.gensalt(rounds=10)).decode('utf8'))" | python3 >> /etc/nginx/htpasswd
|
echo -e "import bcrypt\nprint(bcrypt.hashpw('${systempassword}'.encode('utf8'),bcrypt.gensalt(rounds=10)).decode('utf8'))" | python3 >> /etc/nginx/htpasswd
|
||||||
|
|
|
@ -55,4 +55,14 @@ EOF
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable --now xonotic.service
|
systemctl enable --now xonotic.service
|
||||||
|
|
||||||
|
cat > /etc/nginx/gameserver.d/xonotic.conf <<EOF
|
||||||
|
location /xonotic {
|
||||||
|
proxy_pass http://localhost:62550/;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade \$http_upgrade;
|
||||||
|
proxy_set_header Connection "Upgrade";
|
||||||
|
proxy_set_header Host \$host;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
firewall-cmd --zone=public --add-port=26000/udp --permanent
|
firewall-cmd --zone=public --add-port=26000/udp --permanent
|
||||||
|
|
Reference in New Issue