Nginx proxypass
Monday, 13 March 2017 · 2 messages
TS
Trevor Sewell13 Mar 2017 07:57 #
How could i set up nginx as a proxy to expose the rest api to port 80? I have:
server {
listen 80;
location / {
proxy_pass http://212.71.232.36:8984/rest;
proxy_set_header Authorization "Basic YWRtaW46YWRtaW4=";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
}
}
which works correctly for root, but lets say i tried
server {
listen 80;
location /hello/world {
proxy_pass http://212.71.232.36:8984/rest/hello/world;
proxy_set_header Authorization "Basic YWRtaW46YWRtaW4=";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
}
}
I get:
Database 'hello' was not found.Ideally I’d like a catch all so that the rest api works from this I.P.
CG
Christian Grün13 Mar 2017 16:39 #
Quoted text · Trevor Sewell · 1 line
> proxy_pass http://212.71.232.36:8984/rest;
I am not conversant with Nginx, but maybe you need to add a slash to the URL? If not, maybe the nginx guys can help you?
Quoted text · Trevor Sewell · 2 lines
> I get: > Database 'hello' was not found.
This simply indicates that the database you specified in the URL does not exist.
Written for BaseX 8.6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery