Welcome to Centmin Mod Community
Register Now

Matomo protected directory not working properly

Discussion in 'Other Web Apps usage' started by duderuud, Dec 3, 2024.

Tags:
  1. duderuud

    duderuud Premium Member Premium Member

    244
    78
    28
    Dec 5, 2020
    The Netherlands
    Ratings:
    +171
    Local Time:
    11:30 PM
    1.25 x
    10.6
    • CentOS Version: AlmaLinux 9.5
    • Centmin Mod Version Installed: 131.00stable
    • Nginx Version Installed: 1.27.3
    • PHP Version Installed: 8.3.14
    • MariaDB MySQL Version Installed: 10.6.20
    • When was last time updated Centmin Mod code base ? : just now

    I am testing a new server for Matomo. Got everything working, except for one little thing.
    I need to protect certain files and directories and all is protected, except for one specific file.


    How is that possible? That directory (lang) has like 40 language files and I cannot access any of them with my browser, except for one. File permissions in that directory are all the same. How can I troubleshoot that?
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,328
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    8:30 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  3. duderuud

    duderuud Premium Member Premium Member

    244
    78
    28
    Dec 5, 2020
    The Netherlands
    Ratings:
    +171
    Local Time:
    11:30 PM
    1.25 x
    10.6
    The EN.json file.

    But I've got some reading to do, thanks for the writeup!
     
  4. duderuud

    duderuud Premium Member Premium Member

    244
    78
    28
    Dec 5, 2020
    The Netherlands
    Ratings:
    +171
    Local Time:
    11:30 PM
    1.25 x
    10.6
    Rebuilt the server but using the above guide still the same error:
    Scherm­afbeelding 2024-12-04 om 15.47.37.png

    Why only the en.json, that is so weird...
     
  5. eva2000

    eva2000 Administrator Staff Member

    54,328
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    8:30 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    are you only relying on that reported warning or you can manually access en.json in your browser yourself?

    What output do you get for HTTP header response check

    Code (Text):
    curl -I https://yourdomain.com/lang/en.json


    I actually protect these via Cloudflare Access Access | Zero Trust Network Access and Self-hosted applications · Cloudflare Zero Trust docs and can't access those urls
     
  6. duderuud

    duderuud Premium Member Premium Member

    244
    78
    28
    Dec 5, 2020
    The Netherlands
    Ratings:
    +171
    Local Time:
    11:30 PM
    1.25 x
    10.6
    Yeah, the en.json is accessible with a browser.

    Code (Text):
    HTTP/2 200
    date: Wed, 04 Dec 2024 16:29:48 GMT
    content-type: application/json
    last-modified: Wed, 25 Sep 2024 19:00:05 GMT
    vary: Accept-Encoding
    etag: W/"66f45db5-ad09"
    x-powered-by: centminmod
    expires: Wed, 01 Jan 2025 12:25:10 GMT
    cache-control: max-age=2592000
    

    I also use CF to protect Matomo but want the systems check to pass (and want to know why this is happening).
     
  7. duderuud

    duderuud Premium Member Premium Member

    244
    78
    28
    Dec 5, 2020
    The Netherlands
    Ratings:
    +171
    Local Time:
    11:30 PM
    1.25 x
    10.6
    Anyone has any idea why this is?
     
  8. duderuud

    duderuud Premium Member Premium Member

    244
    78
    28
    Dec 5, 2020
    The Netherlands
    Ratings:
    +171
    Local Time:
    11:30 PM
    1.25 x
    10.6
    Finally getting somewhere, even though it's really strange.

    When I turn off the Cloudflare proxy for the domain (orange cloud icon), the system check of Matomo reports everything is fine.
    When I turn the CF proxy back on, some files and folders are accessible again:

    upload_2025-1-7_16-8-18.png

    I don't have any specific CF rules for that (sub)domain so I can't figure out why it behaves this way...
     
  9. eva2000

    eva2000 Administrator Staff Member

    54,328
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    8:30 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Maybe Cloudflare CDN Cache Rules accidentally caching some files?