From d5ad274f0134c669843ff5e11031bdfa58ae06d2 Mon Sep 17 00:00:00 2001 From: pikami Date: Tue, 28 Feb 2017 19:21:40 +0000 Subject: [PATCH] Added nginx configs --- README.md | 3 ++- nginx_cfg.txt | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 nginx_cfg.txt diff --git a/README.md b/README.md index 92cef3b..40cf024 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,8 @@ So we'll just assume you already have them all running well. 2. Create a user and database for palm-paste 3. Take the 'palm-paste.sql' and import it to your database. 4. Edit configuration settings in config/config.php -5. Change the "RewriteBase" setting in ".htaccess" file to the root of your palm-paste installation +5. (For apache users) Change the "RewriteBase" setting in ".htaccess" file to the root of your palm-paste installation +5. (For nginx users) add the block from nginx_cfg.txt to your nginx server config, replace all occurrences of "paste" with the root of your palm-paste installation 6. Done! * To ensure that pastes with an expiration set get cleaned up, define the cron key in the config and set up a cronjob, for example: diff --git a/nginx_cfg.txt b/nginx_cfg.txt new file mode 100644 index 0000000..231161d --- /dev/null +++ b/nginx_cfg.txt @@ -0,0 +1,10 @@ +# replace all occurrences of "paste" with the root of your palm-paste installation +location /paste { + if ( $uri !~ ^/paste/(index\.php|css|js|robots\.txt|favicon\.ico|) ) { + rewrite ^/paste/u/(.*)$ /paste/index.php?user=$1? last; + rewrite ^/paste/(.*)$ /paste/index.php?page=$1? last; + } + if ( $uri ~* ^/paste/u/(css|js) ) { + rewrite ^/paste/u/(.*)$ /paste/u/$1? last; + } +}