Advertisement
Guest User

nginx-airtime-site

a guest
Apr 2nd, 2011
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. server {
  2. listen 0.0.0.0:80; # change those according to your preferences
  3. server_name localhost; # change those according to your preferences
  4. location / {
  5. root /var/lib/airtime/public;
  6. index index.php;
  7.  
  8. # you can uncomment the 2 lines bellow in order to have additional security...
  9. # also don't forget to change the host variable in airtime's config from
  10. # localhost:80 to user:pass@localhost:80
  11. # or the method I did was to create 2nd vhost called localhost (using server_name in nginx's
  12. # config.
  13. # So I other words my airtime is available to anybody on 0.0.0.0:444 requiring basic auth.
  14. # But with the virtualhost - if you visit the site from the localmashine - http://localhost
  15. # as Airtime does - it doesn't require a password since for that virtual host I removed
  16. # the 2 lines you see bellow.
  17. # auth_basic "";
  18. # auth_basic_user_file /etc/nginx-htpasswd;
  19.  
  20.  
  21. # if file exists return it right away
  22. if (-f $request_filename) {
  23. break;
  24. }
  25.  
  26.  
  27. if (!-e $request_filename) {
  28. rewrite ^(.+)$ /index.php$1 last;
  29. break;
  30. }
  31.  
  32. }
  33.  
  34. # if the request starts with our frontcontroller (and when not always .php), pass it on to fastcgi
  35.  
  36. location ~ ^/index.php
  37. {
  38. fastcgi_pass 127.0.0.1:6000; # I'm using port 6000 because in ls_config.liq
  39. # there is "intra-LS" set on port 9000 which
  40. # is actually the default for fastcgi as well
  41.  
  42. fastcgi_param SCRIPT_FILENAME /var/lib/airtime/public$fastcgi_script_name;
  43. fastcgi_param PATH_INFO $fastcgi_script_name;
  44. include /usr/local/nginx/conf/fastcgi_params;
  45. }
  46.  
  47. # if the file has extension of .php - pass it on to fastcgi
  48. location ~ \.php$
  49. {
  50. fastcgi_pass 127.0.0.1:6000;
  51. fastcgi_param SCRIPT_FILENAME /var/lib/airtime/public$fastcgi_script_name;
  52. fastcgi_param PATH_INFO $fastcgi_script_name;
  53. include /usr/local/nginx/conf/fastcgi_params;
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement