Skip to content
julien-infra-hostinger-web logo

Hostinger Web Infrastructure

julien-infra-hostinger-web

Web infrastructure for Hostinger VPS - Nginx, SSL/Let's Encrypt, static site deployment (Slidev/Astro/Vite), reverse proxy, and 502/504 troubleshooting.

SKILL.md

Full skill instructions

Hostinger Web Infrastructure

Nginx, SSL, and deployment management for srv759970.hstgr.cloud.

Server Info

Observability

First: At the start of execution, display:

🔧 Skill "julien-infra-hostinger-web" activated
PropertyValue
Host[email protected]
Nginx config/​etc/​nginx/​sites-available/
Sites enabled/​etc/​nginx/​sites-enabled/
Logs/​var/​log/​nginx/

1. Nginx Management

Add New Site

ssh srv759970
sudo nano /​etc/​nginx/​sites-available/​mysite

Template (CRITICAL: include IPv6):

server {
    listen 80;
    listen [::]:80;  # IPv6 REQUIRED
    server_name mysite.srv759970.hstgr.cloud;

    location / {
        proxy_pass http://localhost:PORT;
        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;
    }
}
sudo nginx -t
sudo ln -s /​etc/​nginx/​sites-available/​mysite /​etc/​nginx/​sites-enabled/
sudo systemctl reload nginx

SSL with Let's Encrypt

sudo certbot --nginx -d mysite.srv759970.hstgr.cloud
sudo certbot certificates  # Check status
sudo certbot renew --dry-run  # Test renewal

Common Commands

sudo nginx -t                  # Test config
sudo systemctl reload nginx    # Reload (preferred)
sudo tail -f /​var/​log/​nginx/​error.log  # View errors
ls /​etc/​nginx/​sites-enabled/   # List sites

2. Troubleshooting

502 Bad Gateway

# Check backend
docker ps | grep service-name
curl localhost:PORT
docker restart container-name
docker logs container-name --tail 50

504 Gateway Timeout

Add to nginx config:

proxy_read_timeout 300;
proxy_connect_timeout 300;

SSL Certificate Mismatch (IPv6 issue)

Cause: Missing IPv6 listeners

Fix:

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;  # ADD THIS
    # ...
}
sudo nginx -t && sudo systemctl reload nginx
curl -6 https://mysite.srv759970.hstgr.cloud  # Test IPv6

3. Nginx Audit

Check All Sites for IPv6

ssh srv759970 << 'EOF'
for site in /​etc/​nginx/​sites-enabled/​*; do
    if ! grep -q "listen \[::\]:443" "$site" 2>/​dev/​null; then
        echo "MISSING IPv6: $(basename $site)"
    fi
done
EOF

Quick Security Check

curl -sI https://site.srv759970.hstgr.cloud | grep -iE "x-frame|x-content|strict-transport"

4. INCLUZ'HACT Deployment

Environments

EnvBranchURLPortPM2
Productionmainhttps://incluzhact.fr5173incluzhact
Previewstaginghttps://preview.incluzhact.fr5174incluzhact-preview

Quick Deploy

ssh [email protected] << 'EOF'
cd /​var/​www/​incluzhact
git checkout staging  # or main
git pull origin staging
npm install
npm run build
pm2 reload incluzhact-preview  # or incluzhact
EOF

Verify Deployment

pm2 status incluzhact
curl -I https://incluzhact.fr
pm2 logs incluzhact --lines 50

Rollback

ssh srv759970 << 'EOF'
cd /​var/​www/​incluzhact
git reset --hard HEAD^
npm run build
pm2 restart incluzhact
EOF

5. Nginx Templates

Basic Reverse Proxy

server {
    listen 80;
    listen [::]:80;
    server_name app.srv759970.hstgr.cloud;

    location / {
        proxy_pass http://localhost:8000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        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;
    }
}

WordPress

server {
    listen 80;
    listen [::]:80;
    server_name wp.srv759970.hstgr.cloud;
    client_max_body_size 100M;

    location / {
        proxy_pass http://localhost:9000;
        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;
    }
}

6. Static Site Deployment (Slidev, Astro, Vite, etc.)

Workflow Complet

# 1. Build localement
cd /​path/​to/​project
npm run build  # ou pnpm build

# 2. Créer le dossier sur le serveur
ssh srv759970 "sudo mkdir -p /​opt/​PROJET_NAME && sudo chown automation:automation /​opt/​PROJET_NAME"

# 3. Uploader les fichiers
scp -r dist/​* srv759970:/​opt/​PROJET_NAME/

# 4. Créer la config Nginx
ssh srv759970 "sudo tee /​etc/​nginx/​sites-available/​PROJET_NAME << 'EOF'
server {
    listen 80;
    listen [::]:80;  # IPv6 REQUIS pour certbot!
    server_name PROJET_NAME.srv759970.hstgr.cloud;
    root /​opt/​PROJET_NAME;
    index index.html;

    location / {
        try_files \$uri \$uri/ /​index.html;
    }

    # Cache pour assets
    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
        expires 30d;
        add_header Cache-Control \"public, immutable\";
    }
}
EOF"

# 5. Activer le site
ssh srv759970 "sudo ln -sf /​etc/​nginx/​sites-available/​PROJET_NAME /​etc/​nginx/​sites-enabled/ && sudo nginx -t && sudo systemctl reload nginx"

# 6. Obtenir SSL
ssh srv759970 "sudo certbot --nginx -d PROJET_NAME.srv759970.hstgr.cloud --non-interactive --agree-tos --email [email protected]"

One-Liners par Framework

Slidev:

npm run build && scp -r dist/​* srv759970:/​opt/​slides/

Astro:

npm run build && scp -r dist/​* srv759970:/​opt/​astro-site/

Vite/​React/​Vue:

npm run build && scp -r dist/​* srv759970:/​opt/​app-name/

Template Nginx pour Site Statique

server {
    listen 80;
    listen [::]:80;  # CRITIQUE: IPv6 requis pour certbot
    server_name PROJET.srv759970.hstgr.cloud;
    root /​opt/​PROJET;
    index index.html;

    location / {
        try_files $uri $uri/ /​index.html;  # SPA fallback
    }

    # Compression gzip
    gzip on;
    gzip_types text/​plain text/​css application/​json application/​javascript text/​xml application/​xml;

    # Cache assets statiques
    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
        expires 30d;
        add_header Cache-Control "public, immutable";
    }
}

Dépannage Certbot

Erreur "unauthorized" / 401:

# Vérifier que IPv6 retourne 200 (pas 301 redirect)
ssh srv759970 "curl -6 -I http://PROJET.srv759970.hstgr.cloud"

# Si 301 → Ajouter listen [::]:80 à la config
ssh srv759970 "sudo sed -i 's/​listen 80;/​listen 80;\n    listen [::]:80;/' /​etc/​nginx/​sites-available/​PROJET"
ssh srv759970 "sudo nginx -t && sudo systemctl reload nginx"

# Relancer certbot
ssh srv759970 "sudo certbot --nginx -d PROJET.srv759970.hstgr.cloud"

Vérification DNS:

# Le wildcard DNS *.srv759970.hstgr.cloud existe
dig +short monsite.srv759970.hstgr.cloud  # Doit retourner 69.62.108.82

Script Automatisé

# deploy-static.sh <nom-projet> <dossier-local>
PROJECT_NAME=$1
LOCAL_DIR=${2:-dist}

# Upload
scp -r "$LOCAL_DIR"/​* srv759970:/​opt/"$PROJECT_NAME"/

# Config + SSL si nouveau site
ssh srv759970 "[ ! -f /​etc/​nginx/​sites-available/​$PROJECT_NAME ] && {
    sudo tee /​etc/​nginx/​sites-available/​$PROJECT_NAME << EOF
server {
    listen 80;
    listen [::]:80;
    server_name $PROJECT_NAME.srv759970.hstgr.cloud;
    root /​opt/​$PROJECT_NAME;
    index index.html;
    location / { try_files \\\$uri \\\$uri/ /​index.html; }
}
EOF
    sudo ln -sf /​etc/​nginx/​sites-available/​$PROJECT_NAME /​etc/​nginx/​sites-enabled/
    sudo nginx -t && sudo systemctl reload nginx
    sudo certbot --nginx -d $PROJECT_NAME.srv759970.hstgr.cloud --non-interactive --agree-tos --email [email protected]
}"

echo "✅ Déployé: https://$PROJECT_NAME.srv759970.hstgr.cloud"

Quick Reference

# Test nginx
sudo nginx -t

# Reload nginx
sudo systemctl reload nginx

# SSL certificate
sudo certbot --nginx -d domain.com

# Check SSL
sudo certbot certificates

# Deploy INCLUZ'HACT
ssh srv759970 'cd /​var/​www/​incluzhact && git pull && npm install && npm run build && pm2 reload incluzhact'

# Check IPv6
sudo nginx -T | grep -E "listen.*\[::\]"

More DevOps & CI/CD skills

Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.

6K 472.6K
View

Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.

6K 472.6K
View

Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.

1.5K 454.3K
View
azure-kubernetes logo
DevOps & CI/CD

azure-kubernetes

Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.

1.5K 447.1K
View

Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.

92.7K 354.9K
View
just-scrape logo
DevOps & CI/CD

just-scrape

Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.

69 245K
View

Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.

462 159.7K
View

Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.

462 159.1K
View
deploy-to-vercel logo
DevOps & CI/CD

deploy-to-vercel

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

31.9K 146.6K
View
programmatic-seo logo
DevOps & CI/CD

programmatic-seo

Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.

53.3K 140.1K
View

Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.

63 123.5K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
Imagica logo
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View