Nginx configuration for Heimdall

28 Mar 2020

Main Block

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name heimdall.yourdomain.com;

    root /var/www/html/Heimdall/public;
    index index.php index.html index.htm index.nginx-debian.html;
    location / {
        try_files $uri $uri/ /index.php?$query_string;
        autoindex on;
        sendfile off;
    }

    location ~ \.php$ {
      include snippets/fastcgi-php.conf;
      fastcgi_pass unix:/run/php/php7.2-fpm.sock;
    }

    location ~ /\.ht {
      deny all;
    }
}

Add a redirect from http to this https block if you want.