从目录移动到子域名

大家好,

根据 @codinghorror 的建议,为了简化我的设置,并且由于 Let’s Encrypt 现在支持子域名,我决定将我的 Discourse 从 foo.bar/forum 迁移到 forum.foo.bar。

我所做的操作如下:

在 app.yml 中更改了域名,从自定义命令中移除了文件夹重映射,然后通过 Discourse 重映射将 foo.bar/forum 重定向到 forum.foo.bar,最后重新烘焙了帖子。

问题在于:

当我打开 https://forum.foo.bar/ 时,它试图获取 https://stylesheets/etc,这导致论坛显示异常,我无法登录或更改网站主题。

我该如何解决这个问题?

如果需要,这里是安装地址:https://forum.legiochristi.com/
我的 app.yml:## this is the all-in-one, standalone Discourse Docker container template### - Pastebin.com

感谢任何帮助。

Okay I managed to log into the admin panel but I can’t seem to change the default theme since it’s dependent on JavaScript to apply.

I also can’t download my latest backup. Is there a way to do this in command line? Either change the theme or download a backup?

Thanks.

Have you tried safe-mode?

your.site/safe-mode

I’m getting this error when I try:

Chrome says it’s an invalid redirect.

Is there a way to do it through command line?

If there is, I’m not aware of it.

Perhaps someone more knowledgeable can comment on that. :sunflower:

Hope so. I’ll probably nuke it and rebuild after I fetch my last backup.

You did a rebuild too? ./launcher rebuild app

Sure did.

The problem seems to be mostly that it’s trying to fetch https://stylesheets/file.css - I have no idea why that happened or how to fix it.

I see the files present in the container but they’re just not called correctly.

It’s actually using hostname stylesheets there? Or what is the actual url?

You haven’t given enough for us to help you. Can you post your container’s yml file after removing credentials?

Yes it’s actually using hostname stylesheets.

My app.yml is in the first post.

https://pastebin.com/pZPw3Ju5

Your yml file still has the subfolder setting enabled:

DISCOURSE_RELATIVE_URL_ROOT: /

Delete that line from the file and rebuild again.

amazing

i’ll try that in a sec

Okay great that worked! Now the only thing left is to fix all my missing images. I’m getting a 404 on all uploaded avatars and uploaded images. Very odd.

Update:

All images return 404. I rebaked posts, recovered uploads from tombstone, and double-checked whether or not the images exist in the directories.

https://forum.legiochristi.com/uploads/default/original/1X/b104612ae2622e9ccfbb55197bb4e46059a7c171.png

this is 404

yet it exists both in /var/www/discourse/public/uploads/default/original/1X and in /shared/uploads/default/original/1X (which is symlinked successfully, therefor)

I’m at a loss here.

Okay I just restored a week old backup and that didn’t help.

I also tried to chmod the uploads directory to 777

Does anyone have any ideas?

@Ironclad14,我遇到了和你一样的问题。我想知道你是否已经找到解决办法了。如果是的话,能分享一下吗?

提前感谢!