1. user www-data;
  2. worker_processes 1;
  3.  
  4. error_log /var/log/nginx/error.log debug;
  5. pid /var/run/nginx.pid;
  6.  
  7. events {
  8. worker_connections 1024;
  9. # multi_accept on;
  10. }
  11.  
  12. http {
  13. include /etc/nginx/mime.types;
  14.  
  15. access_log /var/log/nginx/access.log;
  16.  
  17. sendfile on;
  18. #tcp_nopush on;
  19.  
  20. #keepalive_timeout 0;
  21. keepalive_timeout 65;
  22. tcp_nodelay on;
  23.  
  24. gzip on;
  25. gzip_disable "MSIE [1-6]\.(?!.*SV1)";
  26.  
  27. include /etc/nginx/conf.d/*.conf;
  28. include /etc/nginx/sites-enabled/*;
  29. # include /etc/nginx/backends.conf;
  30.  
  31. }
  32.  
  33. server {
  34. listen 80;
  35. server_name staging.site.org;
  36. access_log /var/log/nginx/wluw.staging.access.log;
  37.  
  38. location /media/admin/ {
  39. alias /home/wluw/wluw/lib/python2.6/site-packages/django/contrib/admin/media/;
  40. }
  41. location /media/ {
  42. root /home/wluw/staging/wluw/;
  43. }
  44.  
  45. location / {
  46. proxy_pass http://127.0.0.1:8020;
  47. }
  48.  
  49. }
  50.  
  51. server {
  52. listen 80;
  53. server_name site.org;
  54.  
  55. access_log /var/log/nginx/wluw.access.log;
  56.  
  57. location /media/admin/ {
  58. alias /home/wluw/wluw/lib/python2.6/site-packages/django/contrib/admin/media/;
  59. }
  60. location /media/ {
  61. root /home/wluw/wluw/wluw/;
  62. }
  63. location / {
  64. proxy_pass http://127.0.0.1:8010;
  65. }
  66.  
  67. }
  68.  
  69.  
  70.  
  71. server {
  72. server_name www.staging.site.org;
  73. rewrite ^(.*) http://stag.site.org$1 permanent;
  74. }
  75.  
  76. server {
  77. server_name www.site.org;
  78. rewrite ^(.*) http://wluw.org$1 permanent;
  79. }