- listen 80;
- server_name .openstreetmap.org api.openstreetmap.org;
- root /home/rails/public;
- index index.html;
- access_log /var/log/nginx/openstreetmap.org.access.log;
-
- include /etc/nginx/fastcgi_params;
-
- #Redirect Historical Links to correct servers
- location /trac/ {
- rewrite ^/trac/(.*)$ http://trac.openstreetmap.org/$1 permanent;
- }
-
- location /wiki/ {
- rewrite ^/wiki/(.*)$ http://wiki.openstreetmap.org/$1 permanent;
- }
-
- location / {
- allow all;
- }
-
- #Handle api.openstreetmap/ -> api.openstreetmap/api/
- if ($host ~* api\.(.*)) {
- rewrite ^/(0\.[0-9]+)/(.*)$ /api/$1/$2;
- }
-
- location /api/ {
- include /etc/nginx/fastcgi_params;
- if ($http_user_agent ~ "^tilesAtHome") {
- #deny all;
- fastcgi_pass tah_backend;
- break;
- }
- }
-
- location ~ ^/api/0\.6/(map|relation|trackpoints|amf|amf/read|swf/trackpoints|trace/[0-9]+/data)$ {
- fastcgi_pass bulkapi_backend;
- break;
- }
-
- location ~ ^/api/0\.6/.*/search$ {
- fastcgi_pass bulkapi_backend;
- break;
- }
-
- location ~ ^/api/0\.6/.*/full$ {
- fastcgi_pass bulkapi_backend;
- break;
- }
-
- # fastcgi Web / Data Browser / Relations etc
- location ~ ^/api/0\.6/ {
- fastcgi_pass api_backend;
- break;
- }
-
- #Deny unknown API version
- location ~ ^/api/0\.[0-9]+/ {
- deny all;
- }
-
- #Handle Special Case Expiry
- location ~ ^/(export|openlayers)/ {
- expires 7d;
- }
- location ~ ^/(images|javascripts|stylesheets)/ {
- expires max;
- }
-
- location / {
- fastcgi_index index.html;
- if (!-f $request_filename) {
- fastcgi_pass web_backend;
- break;
- }
- }
-
- location /crossdomain.xml {
- default_type text/x-cross-domain-policy;
- }
-
- #error_page 404 /404.html;
+ listen 80;
+ server_name .openstreetmap.org api.openstreetmap.org;
+ root /home/rails/public;
+ index index.html;
+ access_log /var/log/nginx/openstreetmap.org.access.log;
+
+ include /etc/nginx/fastcgi_params;
+
+ #Redirect Historical Links to correct servers
+ location /trac/ {
+ rewrite ^/trac/(.*)$ http://trac.openstreetmap.org/$1 permanent;
+ }
+
+ location /wiki/ {
+ rewrite ^/wiki/(.*)$ http://wiki.openstreetmap.org/$1 permanent;
+ }
+
+ location / {
+ allow all;
+ }
+
+ #Handle api.openstreetmap/ -> api.openstreetmap/api/
+ if ($host ~* api\.(.*)) {
+ rewrite ^/(0\.[0-9]+)/(.*)$ /api/$1/$2;
+ }
+
+ location /api/ {
+ include /etc/nginx/fastcgi_params;
+ if ($http_user_agent ~ "^tilesAtHome") {
+ #deny all;
+ fastcgi_pass tah_backend;
+ break;
+ }
+ }
+
+ location ~ ^/api/0\.6/(map|relation|trackpoints|amf|amf/read|swf/trackpoints|trace/[0-9]+/data)$ {
+ fastcgi_pass bulkapi_backend;
+ break;
+ }
+
+ location ~ ^/api/0\.6/.*/search$ {
+ fastcgi_pass bulkapi_backend;
+ break;
+ }
+
+ location ~ ^/api/0\.6/.*/full$ {
+ fastcgi_pass bulkapi_backend;
+ break;
+ }
+
+ # fastcgi Web / Data Browser / Relations etc
+ location ~ ^/api/0\.6/ {
+ fastcgi_pass api_backend;
+ break;
+ }
+
+ #Deny unknown API version
+ location ~ ^/api/0\.[0-9]+/ {
+ deny all;
+ }
+
+ #Handle Special Case Expiry
+ location ~ ^/(export|openlayers)/ {
+ expires 7d;
+ }
+ location ~ ^/(images|javascripts|stylesheets)/ {
+ expires max;
+ }
+
+ location / {
+ fastcgi_index index.html;
+ if (!-f $request_filename) {
+ fastcgi_pass web_backend;
+ break;
+ }
+ }
+
+ location /crossdomain.xml {
+ default_type text/x-cross-domain-policy;
+ }
+
+ #error_page 404 /404.html;