7 days later
6 days later

is the Nginx Helper wp plugin necessary for fastcgi cache to work or it's just for the purge cache to work? because I do it manually anyway

7 months later

Hi, I did follow your instruction and it worked, thanks for the tutorial.
But, I got a problem that is when I enable "Anti-XSS attack (Base directory limit)(open_basedir)" feature for the website, I can't do "Purge Cache" from the Nginx-Helper plugin, there was no-showed error, I clicked on it, and I check the cache folder in the server, the cached files were still there.
"Purge Cache" works well when I disable "Anti-XSS attack (Base directory limit)(open_basedir)".

So, is there any solution to that? I want to enable "Anti-XSS attack (Base directory limit)(open_basedir)"

    This doesn't work if Wordpress is in a subdirectory, what should be modified for it to work?

    aaPanel_Kern Thank you! it works well now. 😀

    I want to share my work here.
    I did update the file: /www/server# vim panel/class/panelSite.py

    As you can see in the picture, I added /dev/shm, /dev/shm is my cache path.

    Do not forget to restart the panel to apply your change.

    4 months later

    aaPanel_Kern

    I had added the headers in site config. Here are the headers that i added in site config. Without NGINX cache (NGINX Helper) its working fine.
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Frame-Options "ALLOW-FROM *";
    add_header X-Content-Type-Options "nosniff" always;
    add_header Referrer-Policy "strict-origin-when-cross-origin";
    add_header Permissions-Policy "geolocation=(),midi=(),sync-xhr=(),microphone=(),camera=(),magnetometer=(),gyroscope=(),fullscreen=(self),payment=()";
    add_header Content-Security-Policy "upgrade-insecure-requests";

    Permission, referral and content security is what having problems.

      19 days later

      Hello, I have done the steps here:

      1. Added these 4 lines in nginx configuration
        fastcgi_cache_key "$scheme$request_method$host$request_uri";
        fastcgi_cache_path /dev/shm/nginx-cache/wp levels=1:2 keys_zone=WORDPRESS:100m inactive=60m max_size=1g;
        fastcgi_cache_use_stale error timeout invalid_header http_500;
        fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
      2. Changed the site configuation from include enable-php-81.conf; to include enable-php-81-wpfastcgi.conf;
      3. Installed Nginx Helper plugin in Wordpress
      4. Added define('RT_WP_NGINX_HELPER_CACHE_PATH','/dev/shm/nginx-cache/wp'); to wp-config.php

      And everything seems to work, I get cache HIT in the header response for the wordpress site main page. Except when I try to go to any other page, I get 404. I notice that the url that doesn't work follows index.php routing page forexample: https://domain.com/index.php/contact/ to go to contact page. What am I missing here? Any ideas?

      Regards,
      Tony

        Connect with us: 📨 Telegram 💬 Discord Email: support@aapanel.com