Nginx local ssl

This commit is contained in:
Alejandro Sarmiento
2024-03-05 23:04:51 +01:00
parent 798a8214a7
commit 774b27278d
7 changed files with 97 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
return 301 https://$server_name$request_uri; # Redirige HTTP a HTTPS
}
server {
listen 443 ssl;
server_name yourdomain.com www.yourdomain.com;
ssl_certificate /etc/nginx/ssl/cert.pem; # Ruta al certificado dentro del contenedor
ssl_certificate_key /etc/nginx/ssl/localserver.key; # Ruta a la clave privada dentro del contenedor
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
}