Amin Sabet
Well-known member
I'll use the minimal config guide here: https://xenforo.com/community/threa...-full-page-guest-caching.110806/#post-1025390
Minimal Config.
nginx.conf
Add below http { block
Code:### FastCGI Cache ################ map $http_cookie $nocachecookie { default 0; ~xf_logged_in 1; } fastcgi_cache_path /tmp/nginx_fastcgi_cache levels=1:2 keys_zone=fastcgicache:200m inactive=30m; fastcgi_cache_key $scheme$request_method$host$request_uri; fastcgi_cache_lock on; fastcgi_cache_use_stale error timeout invalid_header updating http_500; fastcgi_ignore_headers Cache-Control Expires Set-Cookie; ### FastCGI Cache ################
Create new file on /usr/local/nginx/conf/, lets name it php_fastcgi_cache.conf
Copy contents from /usr/local/nginx/conf/php.conf to the newly created conf file php_fastcgi_cache.conf.
On php_fastcgi_cache.conf ad above/before the last line }.
Code:### fastcgi_cache ### fastcgi_cache fastcgicache; fastcgi_cache_bypass $nocachecookie; fastcgi_no_cache $nocachecookie; fastcgi_cache_valid 5m; add_header X-Cache $upstream_cache_status; ### fastcgi_cache end ###
Edit your XenForo Domain Config at /usr/local/nginx/conf/conf.d/yourdomain.com.conf.
Replace every instance of php.conf with php_fastcgi_cache.conf.
Run nprestart.
Done![]()
I think I followed the directions exactly but nginx failed to restart with following error:
Code:
[root@server ~]# nginx -t
nginx: [emerg] "map_hash_bucket_size" directive is duplicate in /usr/local/nginx/conf/nginx.conf:37
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed