Skip to content
Browse files

add nginx file

  • Loading branch information...
1 parent 415d60f commit 3708b84dc991a552b5ad05dc562f766443249830 @ngokevin committed Oct 3, 2012
Showing with 32 additions and 1 deletion.
  1. +1 −1 cyder/urls.py
  2. +31 −0 wsgi/nginx
View
2 cyder/urls.py
@@ -58,5 +58,5 @@
media_url = settings.MEDIA_URL.lstrip('/').rstrip('/')
urlpatterns += patterns('',
(r'^%s/(?P<path>.*)$' % media_url, 'django.views.static.serve',
- {'document_root': settings.MEDIA_ROOT}),
+ {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
)
View
31 wsgi/nginx
@@ -0,0 +1,31 @@
+server {
+ root /home/username/Code/chili/;
+ server_name z.com;
+ gzip off;
+
+ location = /favicon.ico {
+ rewrite "/favicon.ico" /img/favicon.ico;
+ }
+ location /media/ {
+ alias /media/ ;
+ }
+ location /tmp/ {
+ alias /tmp/ ;
+ }
+
+ proxy_set_header Host $host;
+ location / {
+ proxy_read_timeout 180;
+ fastcgi_read_timeout 180;
+ proxy_intercept_errors off;
+ if (-f $request_filename) {
+ add_header X-Static hit;
+ access_log off;
+ }
+
+ if (!-f $request_filename) {
+ proxy_pass http://127.0.0.1:80;
+ add_header X-Static miss;
+ }
+ }
+}

0 comments on commit 3708b84

Please sign in to comment.
Something went wrong with that request. Please try again.