I have a forum URL change from foo.discourse.com to bar.discourse.com.
If I have both domains pointing at the Discourse server is it possible to use Permalinks to redirect all foo domain traffic to the bar domain? Or do I have to take care of this elsewhere?
Am I right in thinking the standard Discourse Docker set up is fronted by an NGINX instance? And can that be modified without jeopardising the normal upgrade path?
I think what you want to do is to modify app.yml so that it adds to necessary lines to the nginx config inside the container to do the redirects. You might have a look at the yml files inside of samples for some examples, but I suspect you’ll need a bit more help.
Lastly, you may need to rebake your posts if they contain references to the old domain; these links will likely go to a dud tracking link as they now appear as external rather than “internal” links. This is fixed by:
cd /var/discourse
./launcher enter app
rake posts:rebake_match["www.old-name.com"]
More info on rebaking options here:
Separate note for Discourse maintainers…
Not sure how important this is overall @codinghorror but it looks like I can’t get a second server { } block to work properly without changing Discourse’s default discourse.conf to specify default_server like so:
If you don’t nominate a default_server then the first server { } block is assumed to be the default and this causes problems.
It would be ideal if the default discourse.conf could be updated to include default_server. The other alternative is to use the DISCOURSE_HOSTNAME env to populate the server value instead of using server _;.