Nginx & Apache Configuration Reference
Web Server Configuration for Xiuno BBS
Xiuno BBS uses pretty URLs that require URL rewriting. Below are ready-to-use configs for both Nginx and Apache.
Nginx
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
root /home/user/public_html;
index forum.php index.html;
location / {
try_files $uri $uri/ /forum.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
fastcgi_index forum.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ ^/(conf|tmp|log|tool)/ {
deny all;
return 404;
}
location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff2)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
location ~ /\. {
deny all;
}
}
Apache (.htaccess)
RewriteEngine On
RewriteBase /
RewriteRule ^(conf|tmp|log|tool)/ - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /forum.php [L]
url_rewrite_on Setting
In conf/conf.php, the url_rewrite_on value controls link format:
| Value | URL format | Requires rewrite rule? |
|---|---|---|
| 0 | ?thread-5.htm | No |
| 1 | thread-5.htm | Yes |
| 3 | /thread/5 | Yes |
If you are not sure, keep it at 0 — everything works without any server-side rewrite rules.