Bu günü Let's Encrypt Let's Encrypt - Free SSL/TLS Certificates Ssl ile uğraşarak geçirdim desem yeridir.
Pek dikkat etmemişim ama ssl cert lerini yanlış kullanıyormusum.
Yani Yanlış halde Config e ekliyormuşum. Doğrusu Bu Şekilde Olmalıymış :)
ssl_certificate ssl/fullchain.pem;
ssl_certificate_key ssl/privkey.pem;
Örnek olarak kullandığımız Nginx Yapılandırma dosyası aşağıda verilmiştir.
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
# Default server configuration
#
server {
listen 443 ssl;
server_name getgnu.troya.ml;
ssl on;
ssl_certificate troya/fullchain.pem;
ssl_certificate_key troya/privkey.pem;
root /var/www/html/troya;
# Add index.php to the list if you are using PHP
index index.html index.htm;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /.ht {
# deny all;
#}
# .htaccess dosyalarina erisime izin verme.
location ~ /.ht {
deny all;
}
# favicon dosyalari icin access log'a yazma ve 204 (No Content) status kodu dondur.
location ~ .(ico)$ {
access_log off;
log_not_found off;
try_files /favicon.ico =204;
}
# static contet dosyalarinin 72 saat cache'te tutulmasini soyle. Access log'a yazma.
location ~ .(jpg|jpeg|png|gif|ico|css|js)$ {
access_log off;
expires 72h;
}
access_log /var/log/nginx/getgnu.troya.ml-acces.log;
error_log /var/log/nginx/getgnu.troya.ml-error.log;
}
# https sunucuya yönlendirmek için
server {
listen 80;
server_name getgnu.troya.ml;
rewrite ^/(.*) https://getgnu.troya.ml/$1 permanent;
}
# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
# listen 80;
# listen [::]:80;
#
# server_name example.com;
#
# root /var/www/example.com;
# index index.html;
#
# location / {
# try_files $uri $uri/ =404;
# }
#}
Yorum Gönder