correct nginx syntax
authorGrant Slater <openstreetmap@firefishy.com>
Mon, 20 Apr 2009 14:37:46 +0000 (14:37 +0000)
committerGrant Slater <openstreetmap@firefishy.com>
Mon, 20 Apr 2009 14:37:46 +0000 (14:37 +0000)
config/nginx.conf

index 04a87ebc20a47881419fd1f3ecff3cf973be5bc0..af43ed2a248d342ce2a8530f78a7ed77dba0c063 100644 (file)
@@ -104,11 +104,11 @@ http {
        }\r
 \r
        server {\r
-        listen   80;\r
-        server_name  .openstreetmap.org api.openstreetmap.org;\r
-               root /home/rails/public\r
-\r
-        access_log  /var/log/nginx/openstreetmap.org.access.log;\r
+               listen   80;\r
+               server_name  .openstreetmap.org api.openstreetmap.org;\r
+               root /home/rails/public;\r
+               index index.html;\r
+               access_log  /var/log/nginx/openstreetmap.org.access.log;\r
 \r
                location / {\r
                        deny 143.210.16.160;\r
@@ -121,52 +121,55 @@ http {
                location /wiki/ {\r
                        rewrite ^/wiki/(.*)$ http://wiki.openstreetmap.org/$1 permanent;\r
                }\r
-\r
-               if ($http_user_agent == "tilesAtHome" {\r
+               \r
+               location /api/ {\r
                        include /etc/nginx/fastcgi_params;\r
-                       fastcgi_pass tah_backend;\r
-                       break;\r
+                       if ($http_user_agent = "tilesAtHome") {\r
+                               fastcgi_pass tah_backend;\r
+                               break;\r
+                       }\r
                }\r
 \r
-               location =~ "^/api/0\.6/(map|trackpoints|amf|amf/read|swf/trackpoints)$" {\r
+               location ~ ^/api/0\.6/(map|trackpoints|amf|amf/read|swf/trackpoints)$ {\r
                        include /etc/nginx/fastcgi_params;\r
                        fastcgi_pass bulkapi_backend;\r
                        break;\r
                }\r
                \r
-               location =~ "^/api/0\.6/.*/search$" {\r
+               location ~ ^/api/0\.6/.*/search$ {\r
                        include /etc/nginx/fastcgi_params;\r
                        fastcgi_pass bulkapi_backend;\r
                        break;\r
                }\r
 \r
-               location =~ "^/api/0\.6/" {\r
+               location ~ ^/api/0\.6/ {\r
                        include /etc/nginx/fastcgi_params;\r
                        fastcgi_pass api_backend;\r
                        break;\r
                }\r
 \r
-               location =~ "^/api/0\.[0-9]+/" {\r
+               location ~ ^/api/0\.[0-9]+/ {\r
                        deny all;\r
                }\r
-               \r
-               if (!-f $request_filename) {\r
+       \r
+               location / {\r
                        include /etc/nginx/fastcgi_params;\r
-                       fastcgi_pass web_backend;\r
-                       break;\r
+                       if (!-f $request_filename) {\r
+                               fastcgi_pass web_backend;\r
+                               break;\r
+                       }\r
                }\r
 \r
                location /crossdomain.xml {\r
-                       default_type text/x-cross-domain-policy\r
+                       default_type text/x-cross-domain-policy;\r
                }\r
 \r
-        #error_page  404  /404.html;\r
-        # redirect server error pages to the static page /50x.html\r
-        error_page   500 502 503 504  /50x.html;\r
-        location = /50x.html {\r
-                root   /var/www/nginx-default;\r
-        }\r
-\r
+               #error_page  404  /404.html;\r
+               # redirect server error pages to the static page /50x.html\r
+               error_page   500 502 503 504  /50x.html;\r
+               location = /50x.html {\r
+                       root   /var/www/nginx-default;\r
+               }\r
        }\r
 }\r
 \r