NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

In: https://wiki.openstreetmap.org/wiki/Overpass_API/Installation I can read: Setting up the Web API only for apache Is it possible dispatcher daemon running for Nginx?

can you help me with an example of nginx.conf?

nginx.conf

worker_processes  1;

events { worker_connections 1024; }

http { include mime.types;

default_type  application/octet-stream;
sendfile        on;
keepalive_timeout  65;

server {
    listen       8000;
location /api/ {
    alias /mnt/data/openstreetmap/osm-3s_v0.7.4/cgi-bin/;
}
#
location /cgi-bin/ {
            gzip off;
            root /mnt/data/openstreetmap/osm-3s_v0.7.4/;
            fastcgi_read_timeout 900;
            fastcgi_pass unix:/var/run/fcgiwrap.socket;
            include /opt/nginx/fastcgi_params;
            fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    }

    location / {
        root   /mnt/data/openstreetmap/osm-3s_v0.7.4/html;
        index  index.html index.htm;
    }
}

}

wget --output-document=test.xml http://localhost:8000/api/interpreter?data=%3Cprint%20mode=%22body%22/%3E --2016-08-14 18:07:38-- http://localhost:8000/api/interpreter?data=%3Cprint%20mode=%22body%22/%3E Petición HTTP enviada, esperando respuesta... 200 OK Longitud: 1983984 (1,9M) [application/octet-stream] Grabando a: “test.xml”

test.xml 100%[======================================================================>] 1,89M --.-KB/s in 0,004s

2016-08-14 18:07:38 (488 MB/s) - “test.xml” guardado [1983984/19839

however in browser (Google chrome) remote: 405 Not Allowed

asked 13 Aug '16, 17:59

arcadio%20ortega's gravatar image

arcadio ortega
41456
accept rate: 0%

edited 14 Aug '16, 17:19


write this

rewrite ^/api/(.+)$ /cgi-bin/$1 last;

instead of

location /api/ {
    alias /mnt/data/openstreetmap/osm-3s_v0.7.4/cgi-bin/;
}
permanent link

answered 15 Aug '16, 09:13

arcadio%20ortega's gravatar image

arcadio ortega
41456
accept rate: 0%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×483
×4

question asked: 13 Aug '16, 17:59

question was seen: 2,744 times

last updated: 15 Aug '16, 09:13

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum