Advertisement
Guest User

sendy nginx rules

a guest
Mar 30th, 2013
788
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. #
  2. # Nginx rewrite rules for Sendy (http://sendy.co)
  3. # PHP-FPM
  4. #
  5. # http://sendy.co/forum/discussion/142/nginx-rewrite-rule
  6. #
  7.  
  8. server {
  9. listen 80;
  10.  
  11. server_name sendy.junon.be www.sendy.junon.be;
  12.  
  13. access_log /usr/local/apache/domlogs/sendy.junon.be-bytes_log bytes_log;
  14. access_log /usr/local/apache/domlogs/sendy.junon.be combined;
  15. error_log /var/log/nginx/vhost-error_log warn;
  16.  
  17. index index.php index.html;
  18. root /home/sendy/public_html;
  19.  
  20. location = / {
  21. index index.php;
  22. }
  23.  
  24. location / {
  25. if (!-f $request_filename){
  26. rewrite ^/([a-zA-Z0-9-]+)$ /$1.php last;
  27. }
  28. }
  29.  
  30. location /l/ {
  31. rewrite ^/l/([a-zA-Z0-9/]+)$ /l.php?i=$1 last;
  32. }
  33.  
  34. location /t/ {
  35. rewrite ^/t/([a-zA-Z0-9/]+)$ /t.php?i=$1 last;
  36. }
  37.  
  38. location /w/ {
  39. rewrite ^/w/([a-zA-Z0-9/]+)$ /w.php?i=$1 last;
  40. }
  41.  
  42. location /unsubscribe/ {
  43. rewrite ^/unsubscribe/(.*)$ /unsubscribe.php?i=$1 last;
  44. }
  45.  
  46. location /subscribe/ {
  47. rewrite ^/subscribe/(.*)$ /subscribe.php?i=$1 last;
  48. }
  49.  
  50. location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
  51. expires max;
  52. log_not_found off;
  53. }
  54.  
  55. location ~ \.php {
  56.  
  57. fastcgi_index index.php;
  58. include fastcgi_params;
  59. keepalive_timeout 0;
  60. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  61. fastcgi_pass 127.0.0.1:9000;
  62.  
  63. }
  64.  
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement