1 user www-data www-data;
4 error_log /var/log/nginx/error.log;
5 pid /var/run/nginx.pid;
8 # max clients = worker_processes * worker_connections
9 worker_connections 1024;
13 include /etc/nginx/mime.types;
14 default_type application/octet-stream;
16 #access_log /var/log/nginx/access.log;
28 # text/html is added gzip_types by default
29 gzip_types text/plain application/x-javascript application/x-shockwave-flash text/css;
31 #NO CGI SUPPORT IN NGINX fix stat .pl later
33 upstream web_backend {
34 server 127.0.0.1:8000;
35 server 127.0.0.1:8001;
36 server 127.0.0.1:8002;
37 server 127.0.0.1:8003;
38 server 127.0.0.1:8004;
39 server 127.0.0.1:8005;
40 server 127.0.0.1:8006;
41 server 127.0.0.1:8007;
42 server 127.0.0.1:8008;
43 server 127.0.0.1:8009;
44 server 127.0.0.1:8010;
45 server 127.0.0.1:8011;
46 server 127.0.0.1:8012;
47 server 127.0.0.1:8013;
48 server 127.0.0.1:8014;
49 server 127.0.0.1:8015;
50 server 127.0.0.1:8016;
51 server 127.0.0.1:8017;
52 server 127.0.0.1:8018;
53 server 127.0.0.1:8019;
54 server 127.0.0.1:8020;
55 server 127.0.0.1:8021;
56 server 127.0.0.1:8022;
57 server 127.0.0.1:8023;
58 server 127.0.0.1:8024;
59 server 127.0.0.1:8025;
60 server 127.0.0.1:8026;
61 server 127.0.0.1:8027;
62 server 127.0.0.1:8028;
63 server 127.0.0.1:8029;
66 upstream api_backend {
67 server 127.0.0.1:8030;
68 server 127.0.0.1:8031;
69 server 127.0.0.1:8032;
70 server 127.0.0.1:8033;
71 server 127.0.0.1:8034;
72 server 127.0.0.1:8035;
73 server 127.0.0.1:8036;
74 server 127.0.0.1:8037;
75 server 127.0.0.1:8038;
76 server 127.0.0.1:8039;
77 server 127.0.0.1:8040;
78 server 127.0.0.1:8041;
79 server 127.0.0.1:8042;
80 server 127.0.0.1:8043;
81 server 127.0.0.1:8044;
84 upstream bulkapi_backend {
85 server 10.0.0.10:8000;
86 server 10.0.0.11:8000;
87 server 10.0.0.12:8000;
88 server 10.0.0.10:8001;
89 server 10.0.0.11:8001;
90 server 10.0.0.12:8001;
91 server 10.0.0.10:8002;
92 server 10.0.0.11:8002;
93 server 10.0.0.12:8002;
94 server 10.0.0.10:8003;
95 server 10.0.0.11:8003;
96 server 10.0.0.12:8003;
99 upstream tah_backend {
100 server 10.0.0.10:8004;
101 server 10.0.0.11:8004;
102 server 10.0.0.12:8004;
103 server 10.0.0.10:8005;
104 server 10.0.0.11:8005;
105 server 10.0.0.12:8005;
110 server_name .openstreetmap.org api.openstreetmap.org;
111 root /home/rails/public;
113 access_log /var/log/nginx/openstreetmap.org.access.log;
115 include /etc/nginx/fastcgi_params;
117 #Redirect Historical Links to correct servers
119 rewrite ^/trac/(.*)$ http://trac.openstreetmap.org/$1 permanent;
123 rewrite ^/wiki/(.*)$ http://wiki.openstreetmap.org/$1 permanent;
130 #Handle api.openstreetmap/ -> api.openstreetmap/api/
131 if ($host ~* api\.(.*)) {
132 rewrite ^/(0\.[0-9]+)/(.*)$ /api/$1/$2
136 include /etc/nginx/fastcgi_params;
137 if ($http_user_agent ~ "^tilesAtHome") {
139 fastcgi_pass tah_backend;
144 location ~ ^/api/0\.6/(map|relation|trackpoints|amf|amf/read|swf/trackpoints|trace/[0-9]+/data)$ {
145 fastcgi_pass bulkapi_backend;
149 location ~ ^/api/0\.6/.*/search$ {
150 fastcgi_pass bulkapi_backend;
154 location ~ ^/api/0\.6/.*/full$ {
155 fastcgi_pass bulkapi_backend;
159 # fastcgi Web / Data Browser / Relations etc
160 location ~ ^/api/0\.6/ {
161 fastcgi_pass api_backend;
165 #Deny unknown API version
166 location ~ ^/api/0\.[0-9]+/ {
170 #Handle Special Case Expiry
171 location ~ ^/(export|openlayers)/ {
174 location ~ ^/(images|javascripts|stylesheets)/ {
179 fastcgi_index index.html;
180 if (!-f $request_filename) {
181 fastcgi_pass web_backend;
186 location /crossdomain.xml {
187 default_type text/x-cross-domain-policy;
190 #error_page 404 /404.html;
191 # redirect server error pages to the static page /50x.html
192 error_page 500 502 503 504 /50x.html;
193 location = /50x.html {
194 root /var/www/nginx-default;