...
VM ou serveur avec IP 192.168.30.3.
Installer Nginx.
Code Block # 1. Mettre à jour le système sudo apt update sudo apt upgrade -y # 2. Installer Nginx sudo apt install nginx -y # 3. Vérifier que Nginx est bien installé et actif sudo systemctl status nginx # 4. Démarrer Nginx si besoin sudo systemctl start nginx # 5. Activer Nginx pour qu’il se lance automatiquement au démarrage sudo systemctl enable nginx
Configurer un proxy_pass vers ton GLPI :
Code Block # Aller dans le dossier de config Nginx cd /etc/nginx/sites-available/ # Créer un nouveau fichier pour GLPI sudo nano glpi.conf
Code Block # Redirection HTTP vers HTTPS server { listen 80; server_name glpi.comptaplus.loc; return 301 https://$host$request_uri; } # Reverse Proxy HTTPS server { listen 443 ssl; server_name glpi.tondomainecomptaplus.frloc; ssl_certificate /etc/letsencrypt/live/glpi.tondomaine.fr/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/glpi.tondomaine.fr/privkey.pem; # Headers de sécurité add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header X-Content-Type-Options "nosniff" always; add_header X-Frame-Options "DENY" always; add_header X-XSS-Protection "1; mode=block" always; location / { proxy_pass https://192.168.20.3/; # Adresse interne de ton serveur GLPI 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_ssl_verify off; # À activer si tu as un vrai certificat sur ton GLPI interne } }
Code Block # Créer un lien symbolique dans sites-enabled sudo ln -s /etc/nginx/sites-available/glpi.conf /etc/nginx/sites-enabled/ # Tester la configuration Nginx pour être sûr qu’il n’y a pas d'erreurs sudo nginx -t # Recharger Nginx pour appliquer la nouvelle config sudo systemctl reload nginx
...