diff options
Diffstat (limited to 'conf/nginx.conf.example')
-rw-r--r-- | conf/nginx.conf.example | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/conf/nginx.conf.example b/conf/nginx.conf.example new file mode 100644 index 000000000..253024ca6 --- /dev/null +++ b/conf/nginx.conf.example @@ -0,0 +1,49 @@ +# An example configuration for running FixMyStreet under nginx. You +# will also need to set up the FixMyStreet Catalyst FastCGI backend. +# An example sysvinit script to help with this is shown given in the file +# sysvinit-catalyst-fastcgi.example in this directory. + +# Copyright (c) 2011 UK Citizens Online Democracy. All rights reserved. +# Email: team@mysociety.org +# WWW: http://www.mysociety.org + +server { + + access_log /var/www/fixmystreet/logs/access.log; + error_log /var/www/fixmystreet/logs/error.log; + + listen 80; + root /var/www/fixmystreet/fixmystreet/web; + error_page 503 /down.html; + + # These rewrite rules are ported from the Apache configuration in + # conf/httpd.conf + + rewrite ^/rss/council/([0-9]+)$ /rss/reports/$1 permanent; + rewrite ^/report$ /reports permanent; + rewrite '^/{/rss/(.*)}$' /rss/$1 permanent; + rewrite '^/reports/{/rss/(.*)}$' /rss/$1 permanent; + rewrite ^/alerts/?$ /alert permanent; + + location /mapit { + proxy_pass http://mapit.mysociety.org/; + proxy_set_header X-Real-IP $remote_addr; + } + + location / { + if (-f $document_root/down.html) { + return 503; + } + try_files $uri @catalyst; + } + location /down.html { + internal; + } + + location @catalyst { + include /etc/nginx/fastcgi_params; + fastcgi_param PATH_INFO $fastcgi_script_name; + fastcgi_param SCRIPT_NAME ''; + fastcgi_pass 127.0.0.1:9000; + } +} |