63240f2e52
- nginx.conf: sert l'application sur 80 et 443 sans redirection interne (l'ancien "return 301 https://\$server_name" renvoyait vers localhost, server_name étant codé à localhost). NPM gère déjà le TLS/redirect public. - bootstrap/app.php: trustProxies(at: '*') pour que Laravel lise X-Forwarded-Proto/Host et génère les bonnes URL derrière NPM. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
31 lines
999 B
Nginx Configuration File
31 lines
999 B
Nginx Configuration File
# Ce serveur nginx est DERRIÈRE nginx-proxy-manager (NPM), qui termine le TLS
|
|
# public (certificat Let's Encrypt) et force déjà HTTP -> HTTPS pour le domaine.
|
|
# Ici, on se contente donc de SERVIR l'application, sans redirection interne
|
|
# (l'ancienne redirection vers https://$server_name renvoyait vers "localhost").
|
|
server {
|
|
listen 80;
|
|
listen 443 ssl;
|
|
server_name app.sam-coffre.duckdns.org localhost _;
|
|
|
|
ssl_certificate /var/www/cert.pem;
|
|
ssl_certificate_key /var/www/cert.key;
|
|
|
|
index index.php index.html;
|
|
root /var/www/public;
|
|
|
|
location ~ \.php$ {
|
|
try_files $uri =404;
|
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
|
fastcgi_pass app:9000;
|
|
fastcgi_index index.php;
|
|
include fastcgi_params;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.php?$query_string;
|
|
gzip_static on;
|
|
}
|
|
}
|