Code: Select all
.htaccessTo make sure your clean SEO URLs, sitemaps, and front controllers route properly without throwing 404s, here is a clean, tested Nginx server block snippet:
Code: Select all
location / {
try_files $uri $uri/ @rewriteapp;
}
# Pass rewritten requests to phpBB front controller / rewrite engine
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
# Deny access to sensitive phpBB internal files
location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|phpbb|store) {
deny all;
return 403;
}
# Pass PHP scripts to FastCGI
location ~ \.php(/|$) {
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
}
- Always test the configuration with before reloading.
Code: Select all
nginx -t - Reload the service using .
Code: Select all
systemctl reload nginx - Purge your forum cache in the phpBB ACP or by emptying the directory.
Code: Select all
cache/production/