【发布时间】:2016-08-15 16:05:54
【问题描述】:
在: https://wiki.openstreetmap.org/wiki/Overpass_API/Installation 我会读: 仅为 apache 设置 Web API。 Nginx 可以吗?
我正在尝试,但如果我远程询问,我总是发现 405 Not Allowed
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 经度:1983984 (1,9M) [应用程序/八位字节流] 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
在浏览器中(远程客户端): 405 不允许
访问index.html没问题
【问题讨论】:
-
在您链接的 cmets 中,您可以看到我进行了查询,这就是我写在这里的原因
标签: nginx openstreetmap overpass-api