diff --git a/{{cookiecutter.project_slug}}/compose/nginx/nginx-secure.conf b/{{cookiecutter.project_slug}}/compose/nginx/nginx-secure.conf index 78f90279..c014c282 100755 --- a/{{cookiecutter.project_slug}}/compose/nginx/nginx-secure.conf +++ b/{{cookiecutter.project_slug}}/compose/nginx/nginx-secure.conf @@ -37,7 +37,7 @@ http { server_name ___my.example.com___ www.___my.example.com___; location /.well-known/acme-challenge { - proxy_pass http://___LETSENCRYPT_IP___:___LETSENCRYPT_PORT___; + proxy_pass http://certbot:80; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto https; @@ -66,7 +66,7 @@ http { ssl_dhparam /etc/ssl/private/dhparams.pem; location /.well-known/acme-challenge { - proxy_pass http://___LETSENCRYPT_HTTPS_IP___:___LETSENCRYPT_HTTPS_PORT___; + proxy_pass http://certbot:443; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto https; diff --git a/{{cookiecutter.project_slug}}/compose/nginx/nginx.conf b/{{cookiecutter.project_slug}}/compose/nginx/nginx.conf index 91bd96ec..5d7faa39 100644 --- a/{{cookiecutter.project_slug}}/compose/nginx/nginx.conf +++ b/{{cookiecutter.project_slug}}/compose/nginx/nginx.conf @@ -39,7 +39,7 @@ http { server_name ___my.example.com___ ; location /.well-known/acme-challenge { - proxy_pass http://___LETSENCRYPT_IP___:___LETSENCRYPT_PORT___; + proxy_pass http://certbot:80; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto https; diff --git a/{{cookiecutter.project_slug}}/compose/nginx/start.sh b/{{cookiecutter.project_slug}}/compose/nginx/start.sh index 2079e194..2b358ee7 100755 --- a/{{cookiecutter.project_slug}}/compose/nginx/start.sh +++ b/{{cookiecutter.project_slug}}/compose/nginx/start.sh @@ -5,18 +5,9 @@ echo build starting nginx config echo replacing ___my.example.com___/$MY_DOMAIN_NAME -echo replacing ___LETSENCRYPT_IP___/$LETSENCRYPT_PORT_80_TCP_ADDR -echo replacing ___LETSENCRYPT_PORT___/$LETSENCRYPT_PORT_80_TCP_PORT -echo replacing ___APPLICATION_IP___/$APP_PORT_80_TCP_ADDR -echo replacing ___APPLICATION_PORT___/$APP_PORT_80_TCP_PORT # Put your domain name into the nginx reverse proxy config. sed -i "s/___my.example.com___/$MY_DOMAIN_NAME/g" /etc/nginx/nginx.conf -# Add your app's container IP and port into config -sed -i "s/___APPLICATION_IP___/$APP_PORT_80_TCP_ADDR/g" /etc/nginx/nginx.conf -sed -i "s/___APPLICATION_PORT___/$APP_PORT_80_TCP_PORT/g" /etc/nginx/nginx.conf -sed -i "s/___LETSENCRYPT_IP___/$LETSENCRYPT_PORT_80_TCP_ADDR/g" /etc/nginx/nginx.conf -sed -i "s/___LETSENCRYPT_PORT___/$LETSENCRYPT_PORT_80_TCP_PORT/g" /etc/nginx/nginx.conf cat /etc/nginx/nginx.conf echo . @@ -53,27 +44,11 @@ done sleep 15 echo replacing ___my.example.com___/$MY_DOMAIN_NAME -echo replacing ___LETSENCRYPT_IP___/$LETSENCRYPT_PORT_80_TCP_ADDR -echo replacing ___LETSENCRYPT_PORT___/$LETSENCRYPT_PORT_80_TCP_PORT -echo replacing ___LETSENCRYPT_HTTPS_IP___/$LETSENCRYPT_PORT_443_TCP_ADDR -echo replacing ___LETSENCRYPT_HTTPS_PORT___/$LETSENCRYPT_PORT_443_TCP_PORT -echo replacing ___APPLICATION_IP___/$APP_PORT_80_TCP_ADDR -echo replacing ___APPLICATION_PORT___/$APP_PORT_80_TCP_PORT # Put your domain name into the nginx reverse proxy config. sed -i "s/___my.example.com___/$MY_DOMAIN_NAME/g" /etc/nginx/nginx-secure.conf -# Add LE container IP and port into config -sed -i "s/___LETSENCRYPT_IP___/$LETSENCRYPT_PORT_80_TCP_ADDR/g" /etc/nginx/nginx-secure.conf -sed -i "s/___LETSENCRYPT_PORT___/$LETSENCRYPT_PORT_80_TCP_PORT/g" /etc/nginx/nginx-secure.conf -sed -i "s/___LETSENCRYPT_HTTPS_IP___/$LETSENCRYPT_PORT_443_TCP_ADDR/g" /etc/nginx/nginx-secure.conf -sed -i "s/___LETSENCRYPT_HTTPS_PORT___/$LETSENCRYPT_PORT_443_TCP_PORT/g" /etc/nginx/nginx-secure.conf - -# Add your app's container IP and port into config -sed -i "s/___APPLICATION_IP___/$APP_PORT_80_TCP_ADDR/g" /etc/nginx/nginx-secure.conf -sed -i "s/___APPLICATION_PORT___/$APP_PORT_80_TCP_PORT/g" /etc/nginx/nginx-secure.conf - #go! kill $(ps aux | grep 'nginx' | awk '{print $2}') cp /etc/nginx/nginx-secure.conf /etc/nginx/nginx.conf