summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2017-03-01 03:49:38 +0100
committerThomas Lange <code@nerdmind.de>2017-03-01 03:49:38 +0100
commitce094907977fc18e93fcbf90a97e4160ce8eb65f (patch)
tree5c1f9861c400c86e3cf6d448b41be8c4c8a3c518
parentcee28d620ff7d7564e9a27c88bcab1fb593a0c09 (diff)
downloadblog-ce094907977fc18e93fcbf90a97e4160ce8eb65f.tar.gz
blog-ce094907977fc18e93fcbf90a97e4160ce8eb65f.tar.xz
blog-ce094907977fc18e93fcbf90a97e4160ce8eb65f.zip
nginx configuration file added.
-rw-r--r--.ht-nginx37
1 files changed, 37 insertions, 0 deletions
diff --git a/.ht-nginx b/.ht-nginx
new file mode 100644
index 0000000..814bea9
--- /dev/null
+++ b/.ht-nginx
@@ -0,0 +1,37 @@
+#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
+# nginx configuration rules [Thomas Lange <code@nerdmind.de>] #
+#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
+# #
+# This file contains the configuration from the Apaches .htaccess file written #
+# for the nginx high performance web server. Put the content of this file into #
+# the "server {}" block of your nginx virtual host configuration file. #
+# #
+#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
+
+#===============================================================================
+# Error documents
+#===============================================================================
+error_page 403 /system/403.php;
+error_page 404 /system/404.php;
+
+#===============================================================================
+# Forbidden directories
+#===============================================================================
+location ~ ^/core|template/(.*)/(html|lang)/ {
+ return 403;
+}
+
+#===========================================================================
+# Main rules
+#===========================================================================
+rewrite ^/(page|post|user)/([^/]+)/$ /system/$1/main.php?param=$2 break;
+rewrite ^/(page|post|user)/$ /system/$1/list.php break;
+rewrite ^/feed/(page|post)/$ /system/feed/main.php?item=$1 break;
+rewrite ^/(feed|search)/$ /system/$1/main.php break;
+
+#===========================================================================
+# Trailing slashes
+#===========================================================================
+rewrite ^/(page|post|user)/([^/]+)$ /$1/$2/ redirect;
+rewrite ^/(page|post|user|feed|search)$ /$1/ redirect;
+rewrite ^/feed/(post|page)$ /feed/$1/ redirect; \ No newline at end of file