Browse Source

Example NGINX config file for rewrite paths.

master
flash 4 months ago
parent
commit
8d3704809e
  1. 28
      nginx.conf

28
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;
}