From 50ec9ff2c68a49540de771be8e4cafafc392f536 Mon Sep 17 00:00:00 2001 From: Sam DEPARDIEU Date: Fri, 27 Mar 2026 19:09:51 +0100 Subject: [PATCH] =?UTF-8?q?correction=20erreur=20s=C3=A9curit=C3=A9=20des?= =?UTF-8?q?=20informations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 7 +++++-- nginx.conf | 13 +++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 8cdef1d..468f09e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,9 +14,12 @@ services: container_name: laravel_web restart: always ports: - - "8000:80" # C'est ce port 8000 qu'il faudra mettre dans NPM ! + - "8000:80" + - "8443:443" # HTTPS port volumes: - .:/var/www - - ./nginx.conf:/etc/nginx/conf.d/default.conf # On va créer ce petit fichier + - ./nginx.conf:/etc/nginx/conf.d/default.conf + - ./cert.pem:/var/www/cert.pem + - ./cert.key:/var/www/cert.key depends_on: - app \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index 79f8017..5dc3d00 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,12 +1,21 @@ server { listen 80; + server_name localhost; + return 301 https://$server_name$request_uri; +} + +server { + listen 443 ssl; + server_name localhost; + ssl_certificate /var/www/cert.pem; + ssl_certificate_key /var/www/cert.key; index index.php index.html; - root /var/www/public; # ICI est le secret du "Not Found" + root /var/www/public; location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass app:9000; # Il parle au conteneur 'app' + fastcgi_pass app:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;