ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Mattermost Behind Nginx and Cloudflare Script Load Error

    Scheduled Pinned Locked Moved IT Discussion
    nginxmattermostcloudflare
    8 Posts 3 Posters 1.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by

      Mattermost sitting behind Nginx and Cloudflare. I get this error on the web console:

      Loading failed for the <script> with source “https://ajax.cloudflare.com/cdn-cgi/scripts/7089c43e/cloudflare-static/rocket-loader.min.js”.
      

      I've found this mentioned in the MM logs online, but without any resolution. My guess is that maybe I need to override this using an Nginx rewrite? MM has a setting that is supposed to fix this, but does not.

      1 Reply Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller
        last edited by

        According to Mattermost, this setting is supposed to fix this problem, but does not:

        "AllowCorsFrom": "*",
        
        1 Reply Last reply Reply Quote 0
        • scottalanmillerS
          scottalanmiller
          last edited by

          If I disable RocketLoader, everything works, of course. But it would be nice to not have to do that.

          1 Reply Last reply Reply Quote 0
          • black3dynamiteB
            black3dynamite
            last edited by

            Is your setup is Cloudflare proxy -> Nginx proxy -> apache (mattermost)?

            Does it work if Cloudflare is setup as dns only instead?

            scottalanmillerS 1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller @black3dynamite
              last edited by

              @black3dynamite said in Mattermost Behind Nginx and Cloudflare Script Load Error:

              s your setup is Cloudflare proxy -> Nginx proxy -> apache (mattermost)?

              CF Proxy > Nginx Proxy > Mattermost (MM is its own server)

              And yes, if I disable the CF Proxy, it works.

              1 1 Reply Last reply Reply Quote 0
              • 1
                1337 @scottalanmiller
                last edited by

                @scottalanmiller said in Mattermost Behind Nginx and Cloudflare Script Load Error:

                @black3dynamite said in Mattermost Behind Nginx and Cloudflare Script Load Error:

                s your setup is Cloudflare proxy -> Nginx proxy -> apache (mattermost)?

                CF Proxy > Nginx Proxy > Mattermost (MM is its own server)

                And yes, if I disable the CF Proxy, it works.

                Why the double reverse proxies?

                scottalanmillerS 1 Reply Last reply Reply Quote 0
                • scottalanmillerS
                  scottalanmiller @1337
                  last edited by

                  @Pete-S said in Mattermost Behind Nginx and Cloudflare Script Load Error:

                  @scottalanmiller said in Mattermost Behind Nginx and Cloudflare Script Load Error:

                  @black3dynamite said in Mattermost Behind Nginx and Cloudflare Script Load Error:

                  s your setup is Cloudflare proxy -> Nginx proxy -> apache (mattermost)?

                  CF Proxy > Nginx Proxy > Mattermost (MM is its own server)

                  And yes, if I disable the CF Proxy, it works.

                  Why the double reverse proxies?

                  That's the standard. You are always expected to have your node.js servers behind a reverse proxy. And CloudFlare is the CDN cache in front. This is the universal standard for all web servers. Plenty of times to avoid it, of course, but this is the baseline system design.

                  In this case, MM is a raw node server so has none of the protections or handling of a system like Nginx. Nginx also provides the ability to have multiple sites behind one IP address. MM doesn't do that on its own, nor does CloudFlare. No different than how MangoLassi is on NodeBB, also a node platform, behind Nginx, behind CloudFlare.

                  CF can't do the details port and IP handling, Nginx can't do the globally distributed cache.

                  1 1 Reply Last reply Reply Quote 1
                  • 1
                    1337 @scottalanmiller
                    last edited by

                    @scottalanmiller said in Mattermost Behind Nginx and Cloudflare Script Load Error:

                    @Pete-S said in Mattermost Behind Nginx and Cloudflare Script Load Error:

                    @scottalanmiller said in Mattermost Behind Nginx and Cloudflare Script Load Error:

                    @black3dynamite said in Mattermost Behind Nginx and Cloudflare Script Load Error:

                    s your setup is Cloudflare proxy -> Nginx proxy -> apache (mattermost)?

                    CF Proxy > Nginx Proxy > Mattermost (MM is its own server)

                    And yes, if I disable the CF Proxy, it works.

                    Why the double reverse proxies?

                    That's the standard. You are always expected to have your node.js servers behind a reverse proxy. And CloudFlare is the CDN cache in front. This is the universal standard for all web servers. Plenty of times to avoid it, of course, but this is the baseline system design.

                    In this case, MM is a raw node server so has none of the protections or handling of a system like Nginx. Nginx also provides the ability to have multiple sites behind one IP address. MM doesn't do that on its own, nor does CloudFlare. No different than how MangoLassi is on NodeBB, also a node platform, behind Nginx, behind CloudFlare.

                    CF can't do the details port and IP handling, Nginx can't do the globally distributed cache.

                    Thanks for the clarification Scott. I (wrongly) thought that Cloudflare was a full featured proxy and could do the same job as haproxy, nginx etc.

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post