Update nginx to cater for ssl cert

This commit is contained in:
2024-07-17 13:08:09 +02:00
parent ae3745f4af
commit 35dc1cbc09

View File

@@ -1,38 +1,3 @@
# http {
# server_tokens off;
# charset utf-8;
# # always redirect to https
# server {
# listen 80 default_server;
# server_name _;
# return 301 https://$host$request_uri;
# }
# server {
# listen 443 ssl http2;
# # 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 mzansi-innovation-hub.co.za www.mzansi-innovation-hub.co.za;
# root /var/www/html;
# index index.php index.html index.htm;
# location / {
# root /usr/share/nginx/html;
# index index.html;
# try_files $uri $uri/ =404;
# }
# location ~ /.well-known/acme-challenge/ {
# root /var/www/certbot;
# }
# }
# }
events {
worker_connections 1024;
}
@@ -45,15 +10,52 @@ http {
server {
listen 80 default_server;
server_name mzansi-innovation-hub.co.za www.mzansi-innovation-hub.co.za;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
# 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 mzansi-innovation-hub.co.za;
root /var/www/html;
index index.php index.html index.htm;
location / {
proxy_pass http://MIH-UX:83/;
}
location ~ /.well-known/acme-challenge/ {
root /var/www/certbot;
}
# return 301 https://$host$request_uri;
}
}
# events {
# worker_connections 1024;
# }
# http {
# server_tokens off;
# charset utf-8;
# # always redirect to https
# server {
# listen 80 default_server;
# server_name mzansi-innovation-hub.co.za www.mzansi-innovation-hub.co.za;
# location / {
# proxy_pass http://MIH-UX:83/;
# }
# location ~ /.well-known/acme-challenge/ {
# root /var/www/certbot;
# }
# # return 301 https://$host$request_uri;
# }
# }