From 7408eac555edafab366dfeb9b249c3a855823d4d Mon Sep 17 00:00:00 2001 From: yaso-meth Date: Wed, 24 Jul 2024 14:25:15 +0200 Subject: [PATCH] Include ssl for subdomain app & api --- nginx/nginx.conf | 130 +++++++++++++++++++++++------------------------ 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 5967e01c..61a815d7 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -22,53 +22,84 @@ http { server_name app.mzansi-innovation-hub.co.za; - #Web App + # #Web App + # location / { + # proxy_pass http://MIH-UX:83/; + # } + + # location ~ /.well-known/acme-challenge/ { + # root /var/www/certbot; + # } + + return 301 https://app.mzansi-innovation-hub.co.za$request_uri; + } + + server { + listen 443 ssl; + http2 on; + # use the certificates + ssl_certificate /etc/letsencrypt/live/mzansi-innovation-hub.co.za-0002/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/mzansi-innovation-hub.co.za-0002/privkey.pem; + server_name app.mzansi-innovation-hub.co.za; + root /var/www/html; + index index.php index.html index.htm; + + # To allow special characters in headers + ignore_invalid_headers off; + # Allow any size file to be uploaded. + # Set to a value such as 1000m; to restrict file size to a specific value + client_max_body_size 0; + # To disable buffering + proxy_buffering off; + proxy_request_buffering off; + + # Web App location / { proxy_pass http://MIH-UX:83/; } location ~ /.well-known/acme-challenge/ { root /var/www/certbot; - } - - # return 301 https://app.mzansi-innovation-hub.co.za$request_uri; + } } - # server { - # listen 443 ssl; - # http2 on; - # # use the certificates - # ssl_certificate /etc/letsencrypt/live/mzansi-innovation-hub.co.za/fullchain.pem; - # ssl_certificate_key /etc/letsencrypt/live/mzansi-innovation-hub.co.za/privkey.pem; - # server_name app.mzansi-innovation-hub.co.za; - # root /var/www/html; - # index index.php index.html index.htm; - - # # To allow special characters in headers - # ignore_invalid_headers off; - # # Allow any size file to be uploaded. - # # Set to a value such as 1000m; to restrict file size to a specific value - # client_max_body_size 0; - # # To disable buffering - # proxy_buffering off; - # proxy_request_buffering off; - - # # Web App - # location / { - # proxy_pass http://MIH-UX:83/; - # } - - # location ~ /.well-known/acme-challenge/ { - # root /var/www/certbot; - # } - # } - server { listen 80; server_name api.mzansi-innovation-hub.co.za; - #Web App + # #Web App + # location / { + # proxy_pass http://MIH-API-Hub:8080/; + # } + + # location ~ /.well-known/acme-challenge/ { + # root /var/www/certbot; + # } + + return 301 https://api.mzansi-innovation-hub.co.za$request_uri; + } + + server { + listen 443 ssl; + http2 on; + # use the certificates + ssl_certificate /etc/letsencrypt/live/mzansi-innovation-hub.co.za-0002/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/mzansi-innovation-hub.co.za-0002/privkey.pem; + server_name api.mzansi-innovation-hub.co.za; + root /var/www/html; + index index.php index.html index.htm; + + # To allow special characters in headers + ignore_invalid_headers off; + # Allow any size file to be uploaded. + # Set to a value such as 1000m; to restrict file size to a specific value + client_max_body_size 0; + # To disable buffering + proxy_buffering off; + proxy_request_buffering off; + + # Web Api location / { proxy_pass http://MIH-API-Hub:8080/; } @@ -76,38 +107,7 @@ http { location ~ /.well-known/acme-challenge/ { root /var/www/certbot; } - - # return 301 https://api.mzansi-innovation-hub.co.za$request_uri; } - - # server { - # listen 443 ssl; - # http2 on; - # # use the certificates - # ssl_certificate /etc/letsencrypt/live/mzansi-innovation-hub.co.za/fullchain.pem; - # ssl_certificate_key /etc/letsencrypt/live/mzansi-innovation-hub.co.za/privkey.pem; - # server_name api.mzansi-innovation-hub.co.za; - # root /var/www/html; - # index index.php index.html index.htm; - - # # To allow special characters in headers - # ignore_invalid_headers off; - # # Allow any size file to be uploaded. - # # Set to a value such as 1000m; to restrict file size to a specific value - # client_max_body_size 0; - # # To disable buffering - # proxy_buffering off; - # proxy_request_buffering off; - - # # Web App - # location / { - # proxy_pass http://MIH-API-Hub:8080/; - # } - - # location ~ /.well-known/acme-challenge/ { - # root /var/www/certbot; - # } - # } } # # API Hub