Allow Arbitrary Homepage (by Jay Pfaffman)

Oh, so the file should be the default – usually index.html?

Indeed it works! The component expects the URL to be an index file, right?

I simply had to rename my home.html to index.html and change the Nginx configuration to:

        # more config...
        root   /srv/www/zoethical.org/thx;
        index  index.html; # <- this is important

        location = /TransHack_·Xist·nce… {
                default_type text/html;
                alias /srv/www/zoethical.org/thx/index.html; # <- and matches
        }
        location / {
                # nginx magic to try the local file before proxying...
                try_files $uri $uri/ $uri.html @discourse;
        }
        location @discourse {
                # normal discourse proxy
        }

So, to summarize…

If you’re using a static page on the same site as the Discourse instance, make sure your Web server reads the static file(s) – e.g., related CSS – before proxying the requests to the Discourse. Tadaa!

Thank you @pfaffman!

3 Likes