Example NGINX config file for rewrite paths.

This commit is contained in:
Pachira 2024-12-24 10:37:17 +01:00
parent 3cc98eaa18
commit f370da34c2

28
nginx.conf Normal file
View file

@ -0,0 +1,28 @@
server {
root /www/forum.flash.moe/public;
server_name forum.flash.moe;
index index.php;
error_page 404 /404.php;
rewrite ^/category/([0-9]+)/?$ /category.php?id=$1 break;
rewrite ^/category/([0-9]+)/create/?$ /posting.php?cat=$1 break;
rewrite ^/topic/([0-9]+)/?$ /topic.php?id=$1 break;
rewrite ^/topic/([0-9]+)/reply/?$ /posting.php?topic=$1 break;
rewrite ^/topic/([0-9]+)/(lock|unlock|resolve|unresolve|confirm|unconfirm)/?$ /topic.php?id=$1&m=$2 break;
rewrite ^/post/([0-9]+)/?$ /post.php?id=$1 break;
rewrite ^/post/([0-9]+)/edit/?$ /posting.php?post=$1 break;
rewrite ^/user/([0-9]+)/?$ /user.php?id=$1 break;
rewrite ^/settings/?$ /settings.php break;
rewrite ^/search/?$ /search.php break;
rewrite ^/activate/([A-Za-z0-9]+)/?$ /activate.php?key=$1 break;
rewrite ^/register/?$ /register.php break;
rewrite ^/login/?$ /login.php break;
rewrite ^/logout/([A-Za-z0-9]+)/?$ /logout.php?key=$1 break;
include global.conf;
include ssl/flash.moe.ssl.conf;
include php/7.3.conf;
}