From d748a7c6241d135a62d09c77cb00dba10c7d038c Mon Sep 17 00:00:00 2001 From: Dev Uni Date: Sun, 10 Mar 2024 16:11:14 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20aws=20=EB=8B=A4=EB=A5=B8=20=EA=B3=84?= =?UTF-8?q?=EC=A0=95=20=EC=9D=B4=EA=B4=80=ED=95=98=EB=A9=B4=EC=84=9C=20acm?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=EB=A1=9C=20=EC=9D=B8=ED=95=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infra/nginx/nginx.conf | 3 +-- infra/nginx/templates/http-server-notssl.template | 14 ++++++++++++++ infra/scripts/init-nginx-converter.sh | 5 +++-- 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 infra/nginx/templates/http-server-notssl.template diff --git a/infra/nginx/nginx.conf b/infra/nginx/nginx.conf index 73220f14..da7c4d7c 100644 --- a/infra/nginx/nginx.conf +++ b/infra/nginx/nginx.conf @@ -27,6 +27,5 @@ http { '"$http_user_agent" '; include conf.d/upstream.conf; - include conf.d/http-server.conf; - include conf.d/ssl-server.conf; + include conf.d/http-server-notssl.conf; } diff --git a/infra/nginx/templates/http-server-notssl.template b/infra/nginx/templates/http-server-notssl.template new file mode 100644 index 00000000..f99be788 --- /dev/null +++ b/infra/nginx/templates/http-server-notssl.template @@ -0,0 +1,14 @@ +server { + listen 80; + server_name ${SERVER_DOMAIN}; + access_log /var/log/nginx/access.log main; + error_log /var/log/nginx/error.log error; + + location ^~ /actuator { + return 404; + } + + location / { + proxy_pass http://backend; + } +} diff --git a/infra/scripts/init-nginx-converter.sh b/infra/scripts/init-nginx-converter.sh index 861b2aeb..e5562b22 100644 --- a/infra/scripts/init-nginx-converter.sh +++ b/infra/scripts/init-nginx-converter.sh @@ -9,6 +9,7 @@ export SERVER_DOMAIN=${SERVER_DOMAIN} export SERVER_PORT=${SERVER_PORT} export BLUE_CONTAINER=${BLUE_CONTAINER} -envsubst '$SERVER_DOMAIN' < /home/ubuntu/moabam/infra/nginx/templates/http-server.template > /home/ubuntu/moabam/infra/nginx/conf.d/http-server.conf -envsubst '$SERVER_DOMAIN' < /home/ubuntu/moabam/infra/nginx/templates/ssl-server.template > /home/ubuntu/moabam/infra/nginx/conf.d/ssl-server.conf +#envsubst '$SERVER_DOMAIN' < /home/ubuntu/moabam/infra/nginx/templates/http-server.template > /home/ubuntu/moabam/infra/nginx/conf.d/http-server.conf +#envsubst '$SERVER_DOMAIN' < /home/ubuntu/moabam/infra/nginx/templates/ssl-server.template > /home/ubuntu/moabam/infra/nginx/conf.d/ssl-server.conf +envsubst '$SERVER_DOMAIN' < /home/ubuntu/moabam/infra/nginx/templates/http-server-notssl.template > /home/ubuntu/moabam/infra/nginx/conf.d/http-server-notssl.conf envsubst '$BLUE_CONTAINER $SERVER_PORT' < /home/ubuntu/moabam/infra/nginx/templates/upstream.template > /home/ubuntu/moabam/infra/nginx/conf.d/upstream.conf