Estoy creando una aplicación en Laravel que tiene una base de código única que servirá para múltiples nombres de dominio, se puede agregar un nuevo dominio en el CMS, y todo lo que se debe hacer para que ese nuevo dominio funcione es apuntar a sus registros el servidor. El propio CMS mostrará las páginas apropiadas para ese dominio, según la solicitud()->getHost(); función.
La aplicación se gestiona con Laravel Forge.
Mi pregunta es sobre nginx y LetsEncrypt: me gustaría que todos los nuevos dominios agregados de esta manera estén protegidos a través de SSL, ¿debería agregarse cada nuevo dominio para falsificarlo manualmente o hay alguna forma de permitir un TLD comodín en el certificado? ? (Y si es así, ¿es eso un riesgo de seguridad?).
¿Nginx requerirá alguna configuración específica para trabajar con TLD comodín?
Mi objetivo es evitar una configuración adicional y hacer que sea automática, simplemente agregando el nombre de dominio al backend.
¡Gracias!
Siga los pasos. Espero que funcione para ti.
1 - Primer clon del repositorio Letsencrypt/Certbot de Github
cd /opt git clone https://github.com/certbot/certbot.git2 - Ahora ingrese el nuevo directorio creado y ejecute el bot de certificado
cd certbot ./letsencrypt-auto certonly --manual --preferred-challenges=dns --email mymail@gmail.com --server https://acme-v02.api.letsencrypt.org/directory --agree-tos -d *.mywebsite.com3 - Ahora Certbot le pedirá un registro DNS para verificar si realmente tiene derechos en este dominio.
------------------------------------------------------------------ Please deploy a DNS TXT record under the name _acme-challenge.mywebsite.com with the following value: 5GFgEqWd7AQrvHteRtfT5V-XXXXXXXXXXXXXX Before continuing, verify the record is deployed. ------------------------------------------------------------------ Press Enter to Continue4 - Después de agregar este registro DNS TXT a su dominio y espere unos segundos, presione Intro y continúe.
5 - ¡Tu certificado está listo!
IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/mywebsite.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/mywebsite.com/privkey.pem Your cert will expire on 2018-08-22. To obtain a new or tweaked version of this certificate in the future, simply run certbot-auto again. To non-interactively renew *all* of your certificates, run "certbot-auto renew" - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le6 - Ahora copiaremos nuestro fullchain.pem y privkey.pem a nuestra carpeta Nginx y lo agregaremos a la configuración de nuestro servidor Nginx. Por ejemplo;
server { listen 443 ssl; server_name test.mywebsite.com; ssl_certificate /etc/nginx/ssl/fullchain.pem; ssl_certificate_key /etc/nginx/ssl/privkey.pem; ssl_trusted_certificate /etc/nginx/ssl/fullchain.pem; ...Espero que sea útil.