After moving the blog to a cloud server, HTTP worked but browsers marked it as insecure. The usual solution is to install a valid TLS certificate and redirect port 80 to the HTTPS URL.
Configure Nginx
Create or edit the site’s virtual-host file. Use a dedicated HTTP redirect block:
1 | server { |
Serve the site over TLS in a separate block:
1 | server { |
If Nginx is proxying an application rather than serving static Hexo files, replace the root section with a proxy_pass location and forward the host and protocol headers.
Test before reloading:
1 | sudo nginx -t |
Confirm that the certificate covers every hostname, renews automatically, and that firewall/security-group rules allow ports 80 and 443. TLS 1.0 and 1.1 are obsolete and should not be enabled in a new configuration.