mondediefr / docker-flarum

:speech_balloon: :whale: Docker image of Flarum
https://hub.docker.com/r/mondedie/flarum
MIT License
499 stars 129 forks source link

反向代理 #128

Open yangyunwei123 opened 7 months ago

yangyunwei123 commented 7 months ago

为什么使用Nginx Proxy Manager进行反向代理之后访问域名会出现 加载论坛时出错,请强制刷新页面重试这样的错误

Hydrog3n commented 7 months ago

Hello @yangyunwei123 Thank for your issue but can you translate your message in English we everyone can read easily your problematics? Thank you for your understanding !

yangyunwei123 commented 7 months ago

Why does using Nginx Proxy Manager for reverse proxy result in an error message 'Error loading forum, please force refresh the page to retry' when accessing the domain?

yangyunwei123 commented 7 months ago

IMG_20240219_231737

SlimeNull commented 2 months ago

Are you trying to change your domain name? You can open Developer Tools in your browser, and you'll probably see a lot of failed requests. They should be due to a wrong address.

gb16001 commented 1 month ago

我也遇到了同一问题,这是因为FORUM_URL设置错误导致的。
FORUM_URL要放经过域名解析的client browser访问flarum server的地址或是其他accessible的url。
而不是在nginx中设置一个没被解析的,无法到达的无效域名

从webapp的代码:等可以看出,browser访问的web只是一个框架,flarum的core等核心内容通过FORUM_URL填的地址中二次加载得到。也就是说他要填的就是browser访问页面的域名。我也不清楚为什么这么设计,已知的域名再填一次.


same question with me, this is caused by wrong FORUM_URL. FORUM_URL should be the url that client browser can access to your flarum server, usually it's just the domain you put in your browser.
it is obvious in the web app code that flarum core is loaded through FORUM_URL. so you may fix it just put your browser url in FORUM_URL again

try {
                flarum.core.app.load({"resources":[{"type":"forums","id":"1","attributes":{"title":"willing flarum","description":"","showLanguageSelector":true,"baseUrl":"http:\/\/196.168.0.2:81","basePath":"","baseOrigin":"http:\/\/196.168.0.2:81","debug":true,"apiUrl":"http:\/\/196.168.0.2:81\/api","welcomeTitle":"Welcome to Flarum","welcomeMessage":"Enjoy your new forum! Hop over to discuss.flarum.org if you have any questions, or to join our community!","themePrimaryColor":"#4D698E","themeSecondaryColor":"#4D698E","logoUrl":null,"faviconUrl":null,"headerHtml":null,"footerHtml":null,"allowSignUp":true,"defaultRoute":"\/all","canViewForum":true,"canStartDiscussion":false,"canSearchUsers":false,"canViewFlags":false,"guidelinesUrl":null,"allowUsernameMentionFormat":true,"canBypassTagCounts":false,"minPrimaryTags":"1","maxPrimaryTags":"1","minSecondaryTags":"0","maxSecondaryTags":"3"},"relationships":{"groups":{"data":[{"type":"groups","id":"1"},{"type":"groups","id":"2"},{"type":"groups","id":"3"},{"type":"groups","id":"4"}]},"tags":{"data":[{"type":"tags","id":"1"}]}}},{"type":"groups","id":"1","attributes":{"nameSingular":"Admin","namePlural":"Admins","color":"#B72A2A","icon":"fas fa-wrench","isHidden":0}},{"type":"groups","id":"2","attributes":{"nameSingular":"Guest","namePlural":"Guests","color":null,"icon":null,"isHidden":0}},{"type":"groups","id":"3","attributes":{"nameSingular":"Member","namePlural":"Members","color":null,"icon":null,"isHidden":0}},{"type":"groups","id":"4","attributes":{"nameSingular":"Mod","namePlural":"Mods","color":"#80349E","icon":"fas fa-bolt","isHidden":0}},{"type":"tags","id":"1","attributes":{"name":"General","description":null,"slug":"general","color":"#888","backgroundUrl":null,"backgroundMode":null,"icon":null,"discussionCount":0,"position":0,"defaultSort":null,"isChild":false,"isHidden":false,"lastPostedAt":null,"canStartDiscussion":false,"canAddToDiscussion":false}}],"session":{"userId":0,"csrfToken":"SkSqZxKcHSRk7Mk83AOtETpJ4rwutg1lcO56i4Ac"},"locales":{"en":"English"},"locale":"en","apiDocument":{"links":{"first":"http:\/\/10.198.47.105:81\/api\/discussions?sort=\u0026page%5Blimit%5D=20"},"data":[]}});
                flarum.core.app.bootExtensions(flarum.extensions);
                flarum.core.app.boot();
            } catch (e) {
                var error = document.getElementById('flarum-loading-error');
                error.innerHTML += document.getElementById('flarum-content').textContent;
                error.style.display = 'block';
                throw e;
            }

IMG_20240219_231737