From 3d5799ae5830c8cb1e3404b9047a1cb60a45c48d Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Thu, 31 Oct 2024 16:31:42 -0300 Subject: [PATCH] HTTPS --- docker-compose.yml | 1 + nginx.conf | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 283c1d4..c646dd6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,7 @@ services: restart: unless-stopped ports: - "${APP_PORT}:80" + - "${APP_SSL_PORT}:443" volumes: - ${APP_PATH:-.}/:/code - ./nginx.conf:/etc/nginx/conf.d/default.conf diff --git a/nginx.conf b/nginx.conf index fc138fb..e44b81c 100644 --- a/nginx.conf +++ b/nginx.conf @@ -21,3 +21,29 @@ server { fastcgi_pass web:9000; } } +server { + listen 443; + listen [::]:443; + + index index.php; + + error_log /logs/error.log; + access_log /logs/access.log; + + root /code/public; + + location / { + try_files $uri $uri/ /index.php$is_args$args; + } + + location ~ \.php$ { + try_files $uri $uri/ =404; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_NAME $fastcgi_script_name; + fastcgi_index index.php; + fastcgi_read_timeout 3600; + fastcgi_pass web:9000; + } +}