> ## Content Index
> Fetch the complete content index at: https://blog.esadax.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# HTTP omleiden naar HTTPS met Nginx Configuratie
- URL: https://blog.esadax.com/nl/http-omleiden-naar-https-met-nginx-configuratie-2/
- Published: 2025-04-13T00:00:00.000Z
- Updated: 2026-11-15T05:33:43.000Z
- Author: Esadax 
- Tags: #tr-faq-06-ssl-installing-an-ssl-certificate-on-nginx, #nl, #mdx-imported, FAQ

Volg deze stappen om uw website om te leiden van HTTP naar HTTPS met behulp van Nginx:

1. **Zoek het configuratiebestand**:
  - Voor op RHEL gebaseerde systemen: `/etc/nginx/conf.d/default.conf`
  - Voor systemen gebaseerd op Debian: `/etc/nginx/sites-enabled/default`
2. **Identificeer het serverblok voor poort 80**:
  - Gebruik commando's zoals `sudo nginx -T | grep -iw "configuration file"` of zoek naar `include` instructies om het relevante configuratiebestand te vinden.
3. **Voeg de Redirect Directive toe**:
  - Open het geïdentificeerde serverblok in uw favoriete teksteditor.
  - Zorg ervoor dat het zich binnen het `server`\-blok bevindt dat luistert op poort 80.
  - Voeg de regel `return 301 https://$server_name$request_uri;` toe als laatste instructie in het blok.
4. **Start Nginx opnieuw op**:
  - Nadat u wijzigingen hebt aangebracht, start u Nginx opnieuw op om de nieuwe configuratie toe te passen.
5. **Test de omleiding**:
  - Bezoek uw site via HTTP om ervoor te zorgen dat deze correct wordt omgeleid naar HTTPS.

**Voorbeeld van configuratie**:

```nginx
listen 80;
server_name your_domain.com www.your_domain.com;
return 301 https://$server_name$request_uri;

```