Well, @hellekin thought that this deserved its own topic. I’m not quite sure it’s ready for such, but here it is. I’ll have a look at stuff early next week and try to make sure that it looks like something that other people could really use.
add some Nginx configuration to match the HTML file:
location = /TransHack_·Xist·nce… {
default_type text/html;
alias /srv/www/zoethical.org/thx/home.html;
}
Calling the file directly works, but calling https://thx.zoethical.org breaks. As I noticed a check on permalinks, I tried to add a permalink for /. But it did not work either. Might this be an issue with cache?
Edit: I guess it might be due to the fact the instance requires login (SSO), then there’s a dysfunction in this case. I might be willing to make more tests including opening the instance a bit more. After rendering the site public, I still get " Oops! That page doesn’t exist or is private." when hitting the homepage. Any idea why?
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!
Actually a bug remains: although calling the URL https://thx.zoethical.org works from outside, once in the Discourse, clicking the logo does not result in bringing back the overridden page. I noticed a permalink check, so I tried several options, which all failed:
create a permalink from https://thx.zoethical.org to /index.html
create a permalink from https://thx.zoethical.org to /TransHack_·Xist·nce…
combine those with a permalink from /index.html to /TransHack_·Xist·nce…
remove the redirect to /TransHack_·Xist·nce… in the frontend configuration
create a custom_url permalink and point it to an external URL
I guess the issue comes from the fact the script does not try to reload the whole application when clicking on the logo but expects an internal link to be attached to the top path.
I would expect that when either the homepage_url_override or the (e.g., custom_url) permalink points to an absolute URL, then the page is fully reloaded.