From b7cb3733ec83f24fa8a4cf0ec5e88d8ca52c997e Mon Sep 17 00:00:00 2001 From: mcolonna Date: Mon, 9 Jun 2025 16:25:45 +0200 Subject: [PATCH] add: handle sending HTTP request to HTTPS port --- Makefile | 4 ++++ srcs/requirements/nginx/conf/nginx.conf | 1 + srcs/www/497.php | 3 +++ 3 files changed, 8 insertions(+) create mode 100644 srcs/www/497.php diff --git a/Makefile b/Makefile index 9695171..2127a26 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ BUILD_PATH=__build/ DOCKER=docker SRC_COMPOSE=srcs/ +SRC_WWW_MORE=srcs/www/ .ONESHELL : .SHELLFLAGS = -eu -c @@ -48,6 +49,9 @@ $(WWW_PATH) : # move in WWW_PATH rm -rf -- $(WWW_PATH) mv $(BUILD_PATH)"/www/wordpress" $(WWW_PATH) + echo + echo "also copy files from $(SRC_WWW_MORE)" + cp -r $(SRC_WWW_MORE)/. $(WWW_PATH) rm -rf $(BUILD_PATH) diff --git a/srcs/requirements/nginx/conf/nginx.conf b/srcs/requirements/nginx/conf/nginx.conf index 08917f1..34dfca1 100644 --- a/srcs/requirements/nginx/conf/nginx.conf +++ b/srcs/requirements/nginx/conf/nginx.conf @@ -30,6 +30,7 @@ http { ssl_certificate mcolonna.42.fr.crt; ssl_certificate_key mcolonna.42.fr.key; # TODO(any)(secret) secret? # TODO(any)(nocopy) ssl_protocols TLSv1.3; + error_page 497 =301 /497.php; # TODO ssl_ciphers(any) access_log /var/log/nginx/mcolonna.42.fr.access.log main; diff --git a/srcs/www/497.php b/srcs/www/497.php new file mode 100644 index 0000000..d0ca495 --- /dev/null +++ b/srcs/www/497.php @@ -0,0 +1,3 @@ +