From 390dfba4411427ee3d72f7f5bf3c24ea74fd684d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Boe=CC=88s?= Date: Tue, 29 Nov 2016 11:38:32 +0100 Subject: [PATCH] Improved Apache & nginx installation stuff --- docs/advanced-stuff.md | 14 ++++++++++++-- docs/nginx.conf | 17 +++++++++++++++++ src/templates/.htaccess | 3 +++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 docs/nginx.conf diff --git a/docs/advanced-stuff.md b/docs/advanced-stuff.md index 5af63627..53fb8d9a 100644 --- a/docs/advanced-stuff.md +++ b/docs/advanced-stuff.md @@ -1,8 +1,7 @@ ![Blogophon -](blogophon.png) Advanced stuff ============== -In this document you will find some stuff for hardcore CLI wizards. - +In this document you will find some stuff for hardcore CLI wizards and server gurus. Other means of editing articles ------------------------------- @@ -49,3 +48,14 @@ Multiple blogs & global installation ------------------------------------ There are setup instructions on [hot to use Blogophon globally / for multiple blogs on one machine](global-installation.md). + +Server setup +------------ + +### Apache installation + +The Blogophon will generate a `.htaccess` file initially. If possible, move the contents of this file to your server configuration file. If you cannot modify your server configuration, but Apache executes `.htaccess`, Blogophon's `.htaccess` should be all you need. + +### nginx installation + +There is a [sample nginx configuration](nginx.conf) to use for your server. diff --git a/docs/nginx.conf b/docs/nginx.conf new file mode 100644 index 00000000..57929d74 --- /dev/null +++ b/docs/nginx.conf @@ -0,0 +1,17 @@ +server { + server_name example.com; # Replace with server name + + index index.html; + error_page 404 /404.html; + error_page 410 /404.html; + + # General Blogophon redirects + location ~ ^/htdocs/(.*)$ { + rewrite ^(.*)$ /$1 redirect; + } + location ~ ^/(posts|\d+(/\d+(/\d+)?)?)/?$ { + rewrite ^(.*)$ / redirect; + } + + # Add your stuff here +} diff --git a/src/templates/.htaccess b/src/templates/.htaccess index bb47a358..cb26f554 100644 --- a/src/templates/.htaccess +++ b/src/templates/.htaccess @@ -1,3 +1,6 @@ +# ServerName {{config.domain}} +# DocumentRoot {{config.directories.htdocs}} + AddType text/xml xml rss atom AddType text/plain .md AddType application/json .json