Mattermost, Inc.

[Solved] Blank Page when installing Mattermost with Nginx proxy_pass as subdirectory

Hello,

I’ve just installted Mattermost and it runs just fine when using /bin/platform. I want to use Nginx as proxy using this configuration:

location /mattermost/ {
            gzip off;
            proxy_set_header X-Forwarded-Ssl on;
            client_max_body_size 50M;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header Host $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header X-Frame-Options   SAMEORIGIN;
            proxy_pass http://localhost:8065/;
        }

All I get is a blank page with this content:

<!DOCTYPE html> <html> <head> <meta http-equiv=X-UA-Compatible content="IE=edge"> <meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1"> <meta name=robots content="noindex, nofollow"> <meta name=referrer content=no-referrer> <title>Mattermost</title> <meta name=apple-mobile-web-app-capable content=yes> <meta name=apple-mobile-web-app-status-bar-style content=default> <meta name=mobile-web-app-capable content=yes> <meta name=apple-mobile-web-app-title content=Mattermost> <meta name=application-name content=Mattermost> <meta name=format-detection content="telephone=no"> <link rel=apple-touch-icon sizes=57x57 href=/static/files/2a1c469aec4e9dc611d8ff21211b350a.png> <link rel=apple-touch-icon sizes=60x60 href=/static/files/5f235d262658c900615681530b29f56d.png> <link rel=apple-touch-icon sizes=72x72 href=/static/files/32a23a3581becc08838c1c1fed2f6906.png> <link rel=apple-touch-icon sizes=76x76 href=/static/files/1731ddbbe8acf47fca84c4b587dccee5.png> <link rel=apple-touch-icon sizes=144x144 href=/static/files/d286c202041de6ff330bab474f24f8da.png> <link rel=apple-touch-icon sizes=120x120 href=/static/files/5805c6d344fdf7f5443307ff8fafa324.png> <link rel=apple-touch-icon sizes=152x152 href=/static/files/89d5e1a1cc8e97dffbb97f5f8f80a0b9.png> <link rel=icon type=image/png sizes=16x16 href=/static/files/10ee7f4daf66060a2af9c5eef914b4c8.png> <link rel=icon type=image/png sizes=32x32 href=/static/files/02100a5664ea1bf9e4990ad37936af4a.png> <link rel=icon type=image/png sizes=96x96 href=/static/files/3d9b3740060310158cf259a1c2c0ddc9.png> <link rel=icon type=image/png sizes=192x192 href=/static/files/f3ee0663271515c7f6aeb4b8f47d5c12.png> <link rel=manifest href=/static/config/manifest.json> <link rel=stylesheet class=code_theme> <style id=antiClickjack>body{display:none!important}</style> <script src=/static/bundle-3.0.3.js></script> <script>if(self===top){var blocker=document.getElementById("antiClickjack");blocker.parentNode.removeChild(blocker)}</script> </head> <body> <div id=root> <div class=loading-screen style=""> <div class=loading__content> <div class="round round-1"></div> <div class="round round-2"></div> <div class="round round-3"></div> </div> </div> </div> <script>window.setup_root()</script> </body> </html>

So i guess that I’m pointing to the right running instance but it seems that there is a problem that I can not use a subdirectory-configuration in Nginx. Can anyone help me here with this problem?

Hi @marove, can you please share your Mattermost version?

That was a known bug in it was fixed on version 3.0.3, if you have version 3.0.3 running please let me know so you and I can investigate further and find a solution.

Thanks.

Hello @elias thank you for your reply. I am using Mattermost Team Edition Version: 3.0.0 (3.0.3)

Alright @marove

Two things:

  1. What is the default language of your browser?
  2. Can you please send me the Headers for Request and the Response of the locale file?

Note: To locate the Headers its an XHR Request which can be found using the JS Console from your browser?

Hello again @elias,

thank you for your help already. this is the errorlog from my chromium:

https://website.de/static/bundle-3.0.3.js Failed to load resource: the server responded with a status of 404 (Not Found)
website.de/:1 Uncaught TypeError: window.setup_root is not a function
https://website.de/static/files/f3ee0663271515c7f6aeb4b8f47d5c12.png Failed to load resource: the server responded with a status of 404 (Not Found)
https://website.de/static/files/3d9b3740060310158cf259a1c2c0ddc9.png Failed to load resource: the server responded with a status of 404 (Not Found)
https://website.de/static/files/02100a5664ea1bf9e4990ad37936af4a.png Failed to load resource: the server responded with a status of 404 (Not Found)
https://website.de/static/files/10ee7f4daf66060a2af9c5eef914b4c8.png Failed to load resource: the server responded with a status of 404 (Not Found)

It seems, that nginx does not pass the subfolder to mattermost instead of https://website.de/mattermost/ it passes https://website.de/ and then mattermost can not find its files.

I’ve tested the page also with another browser. I also created a different configuration where nginx listens to website.de:8080 and passes it to mattermost (without any subfolder). This works just fine, but a different port than 443 is not possible with my situation here.

Regards
marove

Hi @marove, have you tried to figure out why nginx is failing to pass the subfolder during requests? cause it seems to me that is an nginx configuration thing.

Hello @elias,

this seems to be a problem with mattermost. Comparing it to gogs (also written in go): There I have to define the subfolder address in the config file. Is it possible that this is not yet supported by mattermost?

Regards
Timo Schindler

Hi @marove,

I haven’t test it as a subfolder, it may be that Mattermost doesn’t support this, but i cannot confirm it, although it makes sense if it works for you in the root folder

Hi @marove,

I just confirmed that as of now theres no support to host Mattermost in a subfolder, its planned but can’t tell you exactly for which version is going to be available.

Hello @elias,

thank you for confirming this. I’ve changed the server to listen to another port. This is not the ideal solution but better than nothing.

Regard
marove

So what is the status of this? Is there a place/issue/featureticket where we can see if it is implemented?