mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-02 22:51:34 -06:00
fixed nginx config and all configs (#167)
Basically the nginx config that was used will have this bug called "peer data channel closed" that will happen every single 3 minutes or so and then it will automatically reconnect the nginx file basically whenever someone was in HTTPS instead of HTTP it will just not trust it but with the nginx config and adding the headers the browser will trust the WS connection
This commit is contained in:
@@ -575,29 +575,30 @@ server {
|
||||
listen 80;
|
||||
server_name ${DOMAIN};
|
||||
|
||||
# Public rooms: no authentication
|
||||
location ~ ^/${PATH_PREFIX}/.*$ {
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:${DOCKER_PORT};
|
||||
proxy_set_header Host \$host;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
# WebSocket headers
|
||||
proxy_set_header Upgrade \$http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host \$host;
|
||||
|
||||
# Forwarding headers for reverse proxy
|
||||
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;
|
||||
|
||||
proxy_cache_bypass \$http_upgrade;
|
||||
proxy_buffering off;
|
||||
proxy_read_timeout 900s;
|
||||
}
|
||||
|
||||
# Admin Panel Restricted Access
|
||||
location / {
|
||||
location ~ ^/$ {
|
||||
auth_basic "Restricted Access";
|
||||
auth_basic_user_file /etc/nginx/.htpasswd;
|
||||
|
||||
error_log /var/log/nginx/auth_error.log warn;
|
||||
|
||||
proxy_pass http://127.0.0.1:${DOCKER_PORT};
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade \$http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host \$host;
|
||||
proxy_cache_bypass \$http_upgrade;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
@@ -666,8 +667,8 @@ usage() {
|
||||
echo -e "${YELLOW}Usage:${NC} $0 {add|remove|list|change-password} [username]"
|
||||
echo -e "${YELLOW}Commands:${NC}"
|
||||
echo -e " ${GREEN}add${NC} Add a new user or update an existing user's password"
|
||||
echo -e " ${GREEN}remove${NC} Remove a user"
|
||||
echo -e " ${GREEN}list${NC} List all users"
|
||||
echo -e " ${GREEN}remove${NC} Remove a user"
|
||||
echo -e " ${GREEN}list${NC} List all users"
|
||||
echo -e " ${GREEN}change-password${NC} Change the password of an existing user"
|
||||
exit 1
|
||||
}
|
||||
@@ -797,5 +798,4 @@ echo -e "${AQUA}\n==================================================${NC}"
|
||||
|
||||
|
||||
# Final message
|
||||
echo -e "${GREEN}Installation complete! Access your Neko Rooms at https://${DOMAIN}${NC}"
|
||||
|
||||
echo -e "${GREEN}Installation complete! Access your Neko Rooms at https://${DOMAIN}${NC}"
|
||||
@@ -575,29 +575,30 @@ server {
|
||||
listen 80;
|
||||
server_name ${DOMAIN};
|
||||
|
||||
# Public rooms: no authentication
|
||||
location ~ ^/${PATH_PREFIX}/.*$ {
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:${DOCKER_PORT};
|
||||
proxy_set_header Host \$host;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
# WebSocket headers
|
||||
proxy_set_header Upgrade \$http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host \$host;
|
||||
|
||||
# Forwarding headers for reverse proxy
|
||||
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;
|
||||
|
||||
proxy_cache_bypass \$http_upgrade;
|
||||
proxy_buffering off;
|
||||
proxy_read_timeout 900s;
|
||||
}
|
||||
|
||||
# Admin Panel Restricted Access
|
||||
location / {
|
||||
location ~ ^/$ {
|
||||
auth_basic "Restricted Access";
|
||||
auth_basic_user_file /etc/nginx/.htpasswd;
|
||||
|
||||
error_log /var/log/nginx/auth_error.log warn;
|
||||
|
||||
proxy_pass http://127.0.0.1:${DOCKER_PORT};
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade \$http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host \$host;
|
||||
proxy_cache_bypass \$http_upgrade;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
@@ -667,8 +668,8 @@ usage() {
|
||||
echo -e "${YELLOW}Usage:${NC} $0 {add|remove|list|change-password} [username]"
|
||||
echo -e "${YELLOW}Commands:${NC}"
|
||||
echo -e " ${GREEN}add${NC} Add a new user or update an existing user's password"
|
||||
echo -e " ${GREEN}remove${NC} Remove a user"
|
||||
echo -e " ${GREEN}list${NC} List all users"
|
||||
echo -e " ${GREEN}remove${NC} Remove a user"
|
||||
echo -e " ${GREEN}list${NC} List all users"
|
||||
echo -e " ${GREEN}change-password${NC} Change the password of an existing user"
|
||||
exit 1
|
||||
}
|
||||
@@ -798,5 +799,4 @@ echo -e "${AQUA}\n==================================================${NC}"
|
||||
|
||||
|
||||
# Final message
|
||||
echo -e "${GREEN}Installation complete! Access your Neko Rooms at https://${DOMAIN}${NC}"
|
||||
|
||||
echo -e "${GREEN}Installation complete! Access your Neko Rooms at https://${DOMAIN}${NC}"
|
||||
+16
-8
@@ -2,13 +2,14 @@
|
||||
|
||||
echo "
|
||||
---------------------------------------------------------------
|
||||
__
|
||||
____ ___ / /______ _________ ____ ____ ___ _____
|
||||
/ __ \/ _ \/ //_/ __ \ / ___/ __ \/ __ \/ __ '__ \/ ___/
|
||||
/ / / / __/ ,< / /_/ /_____/ / / /_/ / /_/ / / / / / (__ )
|
||||
/_/ /_/\___/_/|_|\____/_____/_/ \____/\____/_/ /_/ /_/____/
|
||||
|
||||
Automatic installer by m1k1o
|
||||
|
||||
____ ___ / /______ _________ ____ ____ ___ _____
|
||||
/ __ \/ _ \/ //_/ __ \ / ___/ __ \/ __ \/ __ '__ \/ ___/
|
||||
/ / / / __/ ,< / /_/ /_____/ / / /_/ / /_/ / / / / / (__ )
|
||||
/_/ /_/\___/_/|_|\____/_____/_/ \____/\____/_/ /_/ /_/____/
|
||||
|
||||
|
||||
Automatic installer by m1k1o
|
||||
---------------------------------------------------------------
|
||||
|
||||
You need to have:
|
||||
@@ -166,6 +167,12 @@ while true; do
|
||||
break
|
||||
done
|
||||
|
||||
PUBLIC_IP=$(curl -s https://ipinfo.io/ip)
|
||||
read -rp "Enter your server's public IP address (autodetected: ${PUBLIC_IP}): " NEKO_NAT1TO1
|
||||
if [[ -z "${NEKO_NAT1TO1}" ]]; then
|
||||
NEKO_NAT1TO1="${PUBLIC_IP}"
|
||||
fi
|
||||
|
||||
touch "./usersfile"
|
||||
|
||||
# Users
|
||||
@@ -209,6 +216,7 @@ echo "[Y] Got all settings..."
|
||||
echo "NEKO_ROOMS_TRAEFIK_ENTRYPOINT=websecure"
|
||||
echo "NEKO_ROOMS_TRAEFIK_NETWORK=neko-rooms-traefik"
|
||||
echo "NEKO_ROOMS_TRAEFIK_CERTRESOLVER=lets-encrypt"
|
||||
echo "NEKO_NAT1TO1=${NEKO_NAT1TO1}"
|
||||
} > .env
|
||||
|
||||
echo "[Y] Creating env..."
|
||||
@@ -246,4 +254,4 @@ else
|
||||
docker compose up -d
|
||||
fi
|
||||
|
||||
echo "[Y] Finished! You can now visit https://${NEKO_ROOMS_TRAEFIK_DOMAIN}/"
|
||||
echo "[Y] Finished! You can now visit https://${NEKO_ROOMS_TRAEFIK_DOMAIN}/"
|
||||
Reference in New Issue
Block a user