Comment to 'SOLVED:Browser caching is not working properly with nginx or apache'
  •     location ~* ^(/cache_public/|/plugins_public/|/modules/|/studio/|/template/).+\.(jpg|jpeg|gif|css|png|js|ico|svg|eot|ttf|woff|woff2|)$ {
            expires 1M;
            access_log off;
            add_header Cache-Control "public";
            try_files       $uri =404;
        }
    
    

    When I used this caching block for nginx, it stopped loading some pictures on the una installation, such as the default user icon (/modules/boonex/persons/template/images/no-picture-thumb.png) - returns 404.

    Is there something I'm missing?

    Above rules are for situation when UNA is installed in ROOT folder of your domain, if UNA is installed in subfolder then it need to be changed accordingly.

    Understood, but my UNA is installed in the root folder. Something wrong with caching?

    • Understood, but my UNA is installed in the root folder. Something wrong with caching?

      I would suggest to check Nginx access and error logs to find the reason of the problem.

      There was no error posted, just a 404 in the access log.

      If I just change

      try_files \$uri =404;

      to

      try_files $uri =404;

      It works fine after that.

      Is that ok?

      • Understood, but my UNA is installed in the root folder. Something wrong with caching?

        I would suggest to check Nginx access and error logs to find the reason of the problem.

        There was no error posted, just a 404 in the access log.

        If I just change

        try_files \$uri =404;

        to

        try_files $uri =404;

        It works fine after that.

        Is that ok?

        I just realized that within this thread, you don't mention putting a "\" in front of "$uri".

        However, I copied over the code from here, initially, and it is there - that was what was causing the issue.

        https://una.io/page/view-discussion?id=760

        All solved now, thanks.

        • I just realized that within this thread, you don't mention putting a "\" in front of "$uri".

          However, I copied over the code from here, initially, and it is there - that was what was causing the issue.

          https://una.io/page/view-discussion?id=760

          Thank you, I've corrected the code there.