Mercurial > zeropaste
comparison README.md @ 366:26545fe719ca
Remove caching system.
Too much complexity for something that is really simple.
| author | edogawaconan <me@myconan.net> |
|---|---|
| date | Sat, 14 Feb 2015 01:35:45 +0900 |
| parents | a0166874e31e |
| children | 62f2a4b27af6 |
comparison
equal
deleted
inserted
replaced
| 365:9d467113d715 | 366:26545fe719ca |
|---|---|
| 16 * Ruby Bundler | 16 * Ruby Bundler |
| 17 | 17 |
| 18 Optional: | 18 Optional: |
| 19 | 19 |
| 20 * Newrelic account | 20 * Newrelic account |
| 21 * memcached | |
| 22 | |
| 23 Suggested: | |
| 24 | |
| 25 * nginx | |
| 26 | 21 |
| 27 Installation | 22 Installation |
| 28 ------------ | 23 ------------ |
| 29 | 24 |
| 30 Left as an exercise. | 25 Left as an exercise. |
| 31 | |
| 32 nginx configuration | |
| 33 ------------------- | |
| 34 | |
| 35 Here's nginx configuration snippet which use memcached to completely bypass Rails. | |
| 36 | |
| 37 server { | |
| 38 server_name 0paste.com; | |
| 39 listen 80; listen [::]:80; | |
| 40 root /var/www/0paste.com/public; | |
| 41 error_page 445 = @zp; | |
| 42 error_page 404 /404.html; | |
| 43 | |
| 44 if ($request_method = POST) { | |
| 45 return 445; | |
| 46 } | |
| 47 | |
| 48 location / { | |
| 49 expires max; | |
| 50 try_files $uri @zp; | |
| 51 } | |
| 52 | |
| 53 location ~ /(\d+(?:-\x+)?)(?:(\.txt)|\.html)?$ { | |
| 54 expires max; | |
| 55 charset utf-8; | |
| 56 set $memcached_key "zeropaste:pastes:$1$2"; | |
| 57 memcached_pass localhost:11211; | |
| 58 | |
| 59 default_type text/html; | |
| 60 error_page 404 502 = @zp; | |
| 61 } | |
| 62 | |
| 63 location @zp { | |
| 64 proxy_pass http://localhost:9200; | |
| 65 proxy_set_header X-Forwarded-For $remote_addr; | |
| 66 proxy_set_header Host $host; | |
| 67 proxy_intercept_errors on; | |
| 68 } | |
| 69 } | |
| 70 | 26 |
| 71 Misc | 27 Misc |
| 72 ---- | 28 ---- |
| 73 | 29 |
| 74 Pasting from CLI: | 30 Pasting from CLI: |
