i follow this tutorial https://www.aapanel.com/forum/d/593-how-to-enable-fastcgi-cache-for-wordpress-with-aapanel
for my server using laravel and this is working for the server and have great improvement for my ttfb from 10 to 1 but sadly it's effect my session i can login for user but suddenly disappear and also when click another page it's back again so i suspect it's related with session
set $skip_cache 0;
if ($request_method = POST) {
set $skip_cache 1;
}
if ($query_string != "") {
set $skip_cache 1;
}
if ($request_uri ~* "/users/login") {
set $skip_cache 1;
}
if ($request_uri ~* "/home") {
set $skip_cache 1;
}
if ($request_uri ~* "/admin") {
set $skip_cache 1;
}
location ~ [^/]\.php(/|$)
{
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi-74.sock;
fastcgi_index index.php;
include fastcgi.conf;
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
add_header X-Cache "$upstream_cache_status From $host";
fastcgi_cache ylb;
add_header Cache-Control max-age=0;
add_header Nginx-Cache "$upstream_cache_status";
add_header Last-Modified $date_gmt;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
etag on;
fastcgi_cache_valid 200 301 302 1d;
}
location ~ /purge(/.*) {
allow 127.0.0.1;
allow "myserverip";
deny all;
fastcgi_cache_purge ylb "$scheme$request_method$host$1";
}
is there anything i can do for this