diff options
| -rw-r--r-- | nginx_config | 59 | 
1 files changed, 59 insertions, 0 deletions
diff --git a/nginx_config b/nginx_config new file mode 100644 index 0000000..cbf036c --- /dev/null +++ b/nginx_config @@ -0,0 +1,59 @@ + +server { +    listen 80; +    listen [::]:80; +    server_name  piccastapp.com www.piccastapp.com; + +    access_log  /var/log/nginx/piccast_access.log; +    error_log  /var/log/nginx/piccast_error.log; + +    gzip             on; +    gzip_http_version   1.1; +    gzip_min_length  1000; +    gzip_vary        on; +    gzip_proxied     expired no-cache no-store private auth; +    gzip_types       text/plain application/xml application/json; +    gzip_disable     "MSIE [1-6]\."; +    gzip_disable     "wget"; + +    location = / { +        root   /srv/http/piccastapp.com/www; +        index index.html index.htm frontpage.html; +    } + +    location / { +        # Fallthrough to django if file not found +        fastcgi_param PATH_INFO $fastcgi_script_name; +        fastcgi_param REQUEST_METHOD $request_method; +        fastcgi_param QUERY_STRING $query_string; +        fastcgi_param SERVER_NAME $server_name; +        fastcgi_param SERVER_PORT $server_port; +        fastcgi_param SERVER_PROTOCOL $server_protocol; +        fastcgi_param CONTENT_TYPE $content_type; +        fastcgi_param CONTENT_LENGTH $content_length; +        fastcgi_pass_header Authorization; +        fastcgi_intercept_errors off; +        if (!-f $request_filename) { +            fastcgi_pass   unix:/srv/http/piccastapp.com/django.sock; +            break; +        } + +        root   /srv/http/piccastapp.com/www; +        index index.html index.htm; +    } +} + +server { +    listen 80; +    listen [::]:80; +    server_name  piccast.memeschemes.com; + +    access_log  /var/log/nginx/piccast_access.log; +    error_log  /var/log/nginx/piccast_error.log; + +    root   /srv/http/piccastapp.com/www; +    index index.html index.htm; + +    rewrite ^(.*)$      http://piccastapp.com$1    permanent; +} +  | 
