We're getting a high number of errors when indicating we want to use the car Lua profile when using the match service. If I remove this option then the data is returned.
Version: 5.7.0
Should this be a valid option for match or is there potentially something additional that needs to be configured on the server-side to get it up and running?
@nathanpalmer Can you supply the exact URL you're requesting?
Note that the profile name in the URL is just a placeholder - it doesn't affect which dataset OSRM uses. It's purpose in the URL string is to allow you to put a proxy layer in front to direct requests to differently configured OSRM instances.
The car.lua is only used when you preprocess data with osrm-extract.
Thanks for the quick response @danpat. Here is an example url:
/match/v1/driving/polyline(_gu%7DFd%7EqkOqAs%40bBn%40s%40%40g%40CkE%7CD%7CFp%40s%40eGvEn%40nHpADjRpCfKjKIH_N)?steps=true&profile=car&tidy=true&geometries=polyline&overview=false&gaps=split×tamps=1503498432%3B1503498598%3B1503498674%3B1503498753%3B150349883
7%3B1503499850%3B1503500648%3B1503500998%3B1503501266%3B1503501322%3B1503501355%3B1503501388%3B1503501437%3B1503501458&radiuses=5%3B5%3B5%3B5%3B5%3B5%3B5%3B5%3B5%3B5%3B5%3B5%3B5%3B5
The response is
{"message"=>"Query string malformed close to position 131", "code"=>"InvalidQuery"}
If we drop the &profile=car portion of it the requests goes through without an issue. It sounds like from your description though that we don't need this as part of the url as we only have a single-backend though.
@nathanpalmer &profile=car is not a valid query option, please check http://project-osrm.org/docs/v5.10.0/api/#requests
Also at the moment it is not possible to use multiple profiles in one OSRM server instance, so {version} {profile} are just dummy OSRM API parameters. It is possible to setup one OSRM server instance per profile and use {version} and {profile} URI parameters to route requests to a specific instance.
For reference, this is an example nginx.conf configuration that shows how to configure an nginx as a reverse proxy to send different requests to different osrm-routed instances:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
# catch all v5 routes and send them to OSRM
location /route/v1/driving { proxy_pass http://localhost:5000; }
location /route/v1/walking { proxy_pass http://localhost:5001; }
location /route/v1/cycling { proxy_pass http://localhost:5002; }
# Everything else is a mistake and returns an error
location / {
add_header Content-Type text/plain;
return 404 'Your request is bad and you should feel bad.';
}
}
This setup assumes you have 3 different osrm-routed servers running, each using a different .osrm file set, and each running on a different HTTP port (5000, 5001, and 5002).
The driving, walking, cycling part of the URL is used by nginx to select the correct proxy backend, but after that, osrm-routed ignores it and just returns a route on whatever data that instance of osrm-routed is running with. It's up to you to ensure that the correct osrm-routed instance is using the correct datafiles so that /driving/ actually routes on a dataset generated from the car.lua profile.
@oxidase is correct, &profile=car is not a valid parameter and is the cause of the error you're getting.
Thank you both @oxidase and @danpat. This clears it up perfectly. We only need the car profile at the moment but the nginx example will be great if we expand that in the future!
Hello! With the help of firewalld, I sent port 80 to 5000. Everything is OK, but the application asks for https. At forwarding 443 in 5000 does not help. @danpat Your nginx add-on didn't help either. Help please
cat /etc/nginx/nginx.conf
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /usr/share/nginx/modules/.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/.conf;
server {
listen 80 ;
listen [::]:80 ;
server_name route.mysite.pro;
root /usr/share/nginx/html;
location / {
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
listen [::]:443 ssl ipv6only=on;
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/route.insidergroup.pro/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/route.insidergroup.pro/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;}}
Most helpful comment
For reference, this is an example
nginx.confconfiguration that shows how to configure annginxas a reverse proxy to send different requests to differentosrm-routedinstances:This setup assumes you have 3 different
osrm-routedservers running, each using a different.osrmfile set, and each running on a different HTTP port (5000, 5001, and 5002).The
driving,walking,cyclingpart of the URL is used bynginxto select the correct proxy backend, but after that,osrm-routedignores it and just returns a route on whatever data that instance ofosrm-routedis running with. It's up to you to ensure that the correctosrm-routedinstance is using the correct datafiles so that/driving/actually routes on a dataset generated from thecar.luaprofile.@oxidase is correct,
&profile=caris not a valid parameter and is the cause of the error you're getting.