Force ssl in nginx with redirect

Just edit your site configuration file make sure you have a site setup for HTTPS - SSL (port 443)
edit the portion for HTTP:


server {
    listen      80;
    server_name server.yourdomain.tld;
    rewrite     ^   https://$server_name$request_uri? permanent;
}

save and restart nginx
Provided by: ForthScale systems, scalable infrastructure experts

Comments

Popular posts from this blog

How to set or disable auto-logout on bash shell

How to Install Terraform 0.12 on Ubuntu 18.04

How to install PGPool II on PostgreSQL Servers in master-slave architecture + PGPoolAdmin web managment