}\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
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