Added nginx configs

This commit is contained in:
pikami 2017-02-28 19:21:40 +00:00
parent cbb9b9964e
commit d5ad274f01
2 changed files with 12 additions and 1 deletions

View File

@ -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 2. Create a user and database for palm-paste
3. Take the 'palm-paste.sql' and import it to your database. 3. Take the 'palm-paste.sql' and import it to your database.
4. Edit configuration settings in config/config.php 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! 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: * 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:

10
nginx_cfg.txt Normal file
View File

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