nginx http’den https’e yönlendirmek

Aşağıdaki blok ile sunucuya http’den gelen bağlantıları https olarak yönlendirebilirsiniz.

Yani http://www.ornek.com diye gelen isteği https://www.ornek.com adresine yönlendirebilirsiniz.

server {
  listen 80;
  server_name www.ornek.com;

  return 301 https://$host$request_uri;
}

Bir cevap yazın

E-posta hesabınız yayımlanmayacak.

This site uses Akismet to reduce spam. Learn how your comment data is processed.