From f23e982e72864abde9aed61a2d95dcbaa66fa553 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Mon, 20 Apr 2009 14:37:46 +0000 Subject: [PATCH] correct nginx syntax --- config/nginx.conf | 53 +++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/config/nginx.conf b/config/nginx.conf index 04a87ebc2..af43ed2a2 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -104,11 +104,11 @@ http { } server { - listen 80; - server_name .openstreetmap.org api.openstreetmap.org; - root /home/rails/public - - access_log /var/log/nginx/openstreetmap.org.access.log; + 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; location / { deny 143.210.16.160; @@ -121,52 +121,55 @@ http { location /wiki/ { rewrite ^/wiki/(.*)$ http://wiki.openstreetmap.org/$1 permanent; } - - if ($http_user_agent == "tilesAtHome" { + + location /api/ { include /etc/nginx/fastcgi_params; - fastcgi_pass tah_backend; - break; + if ($http_user_agent = "tilesAtHome") { + fastcgi_pass tah_backend; + break; + } } - location =~ "^/api/0\.6/(map|trackpoints|amf|amf/read|swf/trackpoints)$" { + location ~ ^/api/0\.6/(map|trackpoints|amf|amf/read|swf/trackpoints)$ { include /etc/nginx/fastcgi_params; fastcgi_pass bulkapi_backend; break; } - location =~ "^/api/0\.6/.*/search$" { + location ~ ^/api/0\.6/.*/search$ { include /etc/nginx/fastcgi_params; fastcgi_pass bulkapi_backend; break; } - location =~ "^/api/0\.6/" { + location ~ ^/api/0\.6/ { include /etc/nginx/fastcgi_params; fastcgi_pass api_backend; break; } - location =~ "^/api/0\.[0-9]+/" { + location ~ ^/api/0\.[0-9]+/ { deny all; } - - if (!-f $request_filename) { + + location / { include /etc/nginx/fastcgi_params; - fastcgi_pass web_backend; - break; + if (!-f $request_filename) { + fastcgi_pass web_backend; + break; + } } location /crossdomain.xml { - default_type text/x-cross-domain-policy + default_type text/x-cross-domain-policy; } - #error_page 404 /404.html; - # redirect server error pages to the static page /50x.html - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /var/www/nginx-default; - } - + #error_page 404 /404.html; + # redirect server error pages to the static page /50x.html + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /var/www/nginx-default; + } } } -- 2.39.5