bchruby

Force HTTPS redirection with NGINX

Modify the /opt/bitnami/nginx/conf/bitnami/bitnami.conf file so that it looks like this:

server {
      listen 80;
      server_name localhost;
      return 301 https://$host$request_uri;
      include "/opt/bitnami/nginx/conf/bitnami/bitnami-apps-prefix.conf";
  }

After modifying the NGINX configuration file:

  • Open port 443 in the server firewall. Refer to the FAQ for more information.

  • Restart NGINX to apply the changes.

Last modification April 15, 2019