Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 4th, 2012  |  syntax: None  |  size: 1.19 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. worker_processes  1;
  2.  
  3. events {
  4.         worker_connections  1024;
  5. }
  6.  
  7. http {
  8.         include       /sw/etc/nginx/conf/mime.types;
  9.         default_type  application/octet-stream;
  10.  
  11.         #sendfile        on;
  12.         #tcp_nopush     on;
  13.  
  14.         keepalive_timeout  2;
  15.  
  16.         gzip  on;
  17.         gzip_comp_level 2;
  18.         gzip_proxied any;
  19.         gzip_types text/plain text/css application/x-javascript text/xml application/xml+rss text/javascript;
  20.  
  21.         server {
  22.                 listen 80;
  23.                 server_name localhost *.localhost;
  24.  
  25.                 if ($host ~ "^(.*)\.localhost$") {
  26.                         set $subdomain $1;
  27.                 }
  28.  
  29.                 access_log logs/access.log;
  30.                 error_log logs/error.log;
  31.  
  32.                 location ^~ /favicon.ico {
  33.                         return 204;
  34.                 }
  35.  
  36.                 location ^~ /site_media/ {
  37.                         alias F:\\Files\\coding\\django\\pandamian\\mysite\\templates\\;
  38.                 }
  39.                
  40.                 location ~ ^/(cover\.(gif|jpg|jpeg|png))$ {
  41.                         # we can rely on the fact that uninitialised variables are set to ''
  42.                         if ($subdomain = '') {
  43.                                 return 404;
  44.                                 break;
  45.                         }
  46.                         alias F:\\Files\\coding\\django\\pandamian\\mysite\\user_data\\$subdomain\\$1;
  47.                 }
  48.  
  49.                 location / {
  50.                         rewrite ^/development/(.*) /$1 break;
  51.                         proxy_set_header Host $host;
  52.                         proxy_set_header X-Real-IP $remote_addr;
  53.                         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  54.                         proxy_pass      http://localhost:8000;
  55.                 }
  56.         }
  57. }