Ad Widget

Collapse

Zabbix behind Nginx and CloudFlare - TypeError: Template is not a constructor

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saloricardo
    Junior Member
    • Dec 2021
    • 7

    #1

    Zabbix behind Nginx and CloudFlare - TypeError: Template is not a constructor


    Hello everyone, all right?

    Next, I have a test/study environment in Docker. I'm using the latest version of 6.0.

    My environment runs on a Docker, as I mentioned earlier, I have an Nginx Proxy Manager and Authelia for authentication, in addition to everything behind CloudFlare as well.

    I've already removed Authelia's authentication, but according to my tests, the problem is with the reverse proxy, but I can't get the settings right and I don't know what else to do.

    Some Zabbix menus just don't load, like the image below.
    Has anyone ever experienced this? Do you know how to solve?

    Thanks for the help!

    Click image for larger version

Name:	image.png
Views:	877
Size:	53.0 KB
ID:	463583​​
  • codename_sasha
    Junior Member
    • Jan 2023
    • 2

    #2
    Hi, same problem here with latest 6.4.2, using Cloudflare tunnel. Unfortunately no progress so far... Someone suggested disabling chunked encoding on Cloudflare, but didn't help.

    Comment

    • saloricardo
      Junior Member
      • Dec 2021
      • 7

      #3
      Hello, does anyone know how to solve this situation?

      Comment

      • seanbatt
        Junior Member
        • May 2023
        • 5

        #4
        I am testing Zabbix v6.0.16 behind Cloudflare, too.
        I have several similar, show stopping issues where javascript throws errors like "Uncaught ReferenceError: Cannot access 'CWidget' before initialization" and "Uncaught ReferenceError: CDashboard is not defined".
        From what I can see of the javascript read in via jsLoader.php, it seems fine (but I am not knowledgable with javascript).
        Thanks to this thread, I have further ideas to try, e.g.comparing 6.0.16 in my home lab and comparing the concatenated js output from jsLoader.php.
        What the fix might be remains to be seen.

        Best wishes, Sean​

        Comment

        • codename_sasha
          Junior Member
          • Jan 2023
          • 2

          #5
          Hi, disabling rocket loader solved my issue. I made a configuration rule to disable it for individual hostnames and it helped.

          Comment

          • saloricardo
            Junior Member
            • Dec 2021
            • 7

            #6
            Hi codename_sasha, thanks a lot for your help! I disabled the rocket loader and everything just went back to working perfectly. Maybe later I'll study about it, because I saw that it's possible to control the rocker loader through the headers.

            Again, thank you very much!​

            Comment

            • seanbatt
              Junior Member
              • May 2023
              • 5

              #7
              For my problem with javascript, I was hoping this would be the issue, but we checked and Rocket Loader was not enabled. I've run jsLoader.php outside the Cloudflare environment and can see that the js returned is different: the individual js files are returned in a different order. That sort of change seemed a bit gross to be changed by Rocket Loader.

              Comment

              • saloricardo
                Junior Member
                • Dec 2021
                • 7

                #8
                seanbatt, but did you manage to solve the problem or are you still with it?

                Comment

                • seanbatt
                  Junior Member
                  • May 2023
                  • 5

                  #9
                  Originally posted by saloricardo
                  seanbatt, but did you manage to solve the problem or are you still with it?
                  Still have the problem, saloricardo .

                  Comment

                  • saloricardo
                    Junior Member
                    • Dec 2021
                    • 7

                    #10
                    seanbatt, sorry for the long time to reply.

                    You use Nginx reverse proxy?

                    In addition to the CloudFlare configuration, I also added some settings in nginx for Zabbix access.

                    Code:
                    location / {
                        proxy_set_header X-Real-IP $remote_addr;
                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                        proxy_cookie_path / zabbix.domain.com;
                    }
                    ​
                    ps: Attention to the address in proxy_cookie_path.​

                    Comment

                    Working...