vps setup
Some checks failed
Deploy to Railway / deploy (push) Has been cancelled
Network Test / test_network (push) Has been cancelled

This commit is contained in:
Mykhailo Svishchov
2026-03-07 17:36:14 +02:00
parent 82b9cfc8e3
commit 7e2985a1a6
3 changed files with 28 additions and 28 deletions

View File

@@ -44,39 +44,39 @@ COMPOSE_FILE="${PROJECT_DIR}/docker-compose.staged.yml"
# Priority: sites-enabled (what Nginx actually loads) > conf.d > custom paths
NGINX_CONF="${NGINX_CONF:-}"
if [ -z "$NGINX_CONF" ]; then
if [ -f "/etc/nginx/sites-enabled/honey.live" ]; then
NGINX_CONF="/etc/nginx/sites-enabled/honey.live"
if [ -f "/etc/nginx/sites-enabled/testforapp.website" ]; then
NGINX_CONF="/etc/nginx/sites-enabled/testforapp.website"
log "Using Nginx config: $NGINX_CONF (sites-enabled - active config)"
elif [ -f "/etc/nginx/sites-enabled/honey.live.conf" ]; then
NGINX_CONF="/etc/nginx/sites-enabled/honey.live.conf"
elif [ -f "/etc/nginx/sites-enabled/testforapp.website.conf" ]; then
NGINX_CONF="/etc/nginx/sites-enabled/testforapp.website.conf"
log "Using Nginx config: $NGINX_CONF (sites-enabled - active config)"
elif [ -f "/etc/nginx/conf.d/honey.conf" ]; then
NGINX_CONF="/etc/nginx/conf.d/honey.conf"
log "Using Nginx config: $NGINX_CONF (conf.d)"
elif [ -f "/opt/app/nginx/honey.live.conf" ]; then
warn "Found config at /opt/app/nginx/honey.live.conf"
elif [ -f "/opt/app/nginx/testforapp.website.conf" ]; then
warn "Found config at /opt/app/nginx/testforapp.website.conf"
warn "Checking if it's symlinked to /etc/nginx/sites-enabled/..."
if [ -L "/etc/nginx/sites-enabled/honey.live" ] || [ -L "/etc/nginx/sites-enabled/honey.live.conf" ]; then
if [ -L "/etc/nginx/sites-enabled/testforapp.website" ] || [ -L "/etc/nginx/sites-enabled/testforapp.website.conf" ]; then
# Find the actual target
local target=$(readlink -f /etc/nginx/sites-enabled/honey.live 2>/dev/null || readlink -f /etc/nginx/sites-enabled/honey.live.conf 2>/dev/null)
local target=$(readlink -f /etc/nginx/sites-enabled/testforapp.website 2>/dev/null || readlink -f /etc/nginx/sites-enabled/testforapp.website.conf 2>/dev/null)
if [ -n "$target" ]; then
NGINX_CONF="$target"
log "Using Nginx config: $NGINX_CONF (symlink target)"
else
NGINX_CONF="/opt/app/nginx/honey.live.conf"
NGINX_CONF="/opt/app/nginx/testforapp.website.conf"
warn "Using custom path - will update this file, but you may need to copy to sites-enabled"
fi
else
NGINX_CONF="/opt/app/nginx/honey.live.conf"
NGINX_CONF="/opt/app/nginx/testforapp.website.conf"
warn "Using custom path - will update this file, but you may need to copy to sites-enabled"
fi
else
error "Cannot find Nginx config file."
error "Searched:"
error " - /etc/nginx/sites-enabled/honey.live"
error " - /etc/nginx/sites-enabled/honey.live.conf"
error " - /etc/nginx/sites-enabled/testforapp.website"
error " - /etc/nginx/sites-enabled/testforapp.website.conf"
error " - /etc/nginx/conf.d/honey.conf"
error " - /opt/app/nginx/honey.live.conf"
error " - /opt/app/nginx/testforapp.website.conf"
error ""
error "Please set NGINX_CONF environment variable with the correct path."
exit 1