]> git.openstreetmap.org Git - rails.git/blobdiff - config/nginx.conf
Rewrite /0.n/... as /api/0.n/... for the api virtual host.
[rails.git] / config / nginx.conf
index af43ed2a248d342ce2a8530f78a7ed77dba0c063..745fa555ed9f71a7ca99215248af04789a23be3a 100644 (file)
@@ -110,6 +110,10 @@ http {
                index index.html;\r
                access_log  /var/log/nginx/openstreetmap.org.access.log;\r
 \r
                index index.html;\r
                access_log  /var/log/nginx/openstreetmap.org.access.log;\r
 \r
+               if ($host ~* api\.(.*)) {\r
+                       rewrite ^/(0\.[0-9]+)/(.*)$ /api/$1/$2\r
+               }\r
+\r
                location / {\r
                        deny 143.210.16.160;\r
                        allow all; \r
                location / {\r
                        deny 143.210.16.160;\r
                        allow all; \r
@@ -118,6 +122,7 @@ http {
                location /trac/ {\r
                        rewrite ^/trac/(.*)$ http://trac.openstreetmap.org/$1 permanent;\r
                }\r
                location /trac/ {\r
                        rewrite ^/trac/(.*)$ http://trac.openstreetmap.org/$1 permanent;\r
                }\r
+\r
                location /wiki/ {\r
                        rewrite ^/wiki/(.*)$ http://wiki.openstreetmap.org/$1 permanent;\r
                }\r
                location /wiki/ {\r
                        rewrite ^/wiki/(.*)$ http://wiki.openstreetmap.org/$1 permanent;\r
                }\r