I have a web server running by nginx. I registered a free domain name .tk
and installed Let's Encrypt certificate. The following configuration is my HTTPS:
if ($ssl_protocol = "") {
rewrite ^ https://$server_name$request_uri? permanent;
}
But now I remove all of HTTPS configuration in Nginx then it can not access to http://mysite.tk. I also clear cache on browser but it does not work.
Update
My nginx.conf
#user nobody;
worker_processes 4;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
keepalive_timeout 65;
gzip on;
server {
listen 80;
# listen 443 ssl;
server_name xxx.tk;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# TLS configurations
# ssl_certificate /etc/letsencrypt/live/xxx.tk/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/xxx.tk/privkey.pem;
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ssl_prefer_server_ciphers on;
# ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4";
# add_header Strict-Transport-Security max-age=15768000;
# if ($ssl_protocol = "") {
# rewrite ^ https://$server_name$request_uri? permanent;
# }
location / {
index index.php index.html index.htm;
}
location /files {
autoindex on;
}
location ~ \.php$ {
root /home/tester/local/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
From comments:
I restarted daemon after modifying configuration.
Nginx is also listening on port 80, confirmed with:
netstat -pltun
I cleaned everything on my browser. But it still does not work.