From 8d3704809eca4c0208c8982c5b73e55cdeda8e1f Mon Sep 17 00:00:00 2001 From: Julian Date: Wed, 5 May 2021 18:02:10 +0200 Subject: [PATCH] Example NGINX config file for rewrite paths. --- nginx.conf | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 nginx.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..7c45388 --- /dev/null +++ b/nginx.conf @@ -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; +}