I have started datahub with steps from https://datahubproject.io/docs/quickstart
and then add nginx with conf
upstream datahub-front {
server localhost:9002;
}
server {
server_name datahub.myhost.com;
location / {
proxy_pass http://datahub-front;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
listen 80;
}
all works fine at http://datahub.myhost.com:9002
but at http://datahub.myhost.com
i got
Request URL: https://datahub.myhost.com/
Request Method: GET
Status Code: 505 HTTP Version Not Supported
I thing some cfg set up in nginx can fix the problem. pls help
CodePudding user response:
Here is the config I use for a specific location which targets a specific port on my public server :
location /somelocation/ {
proxy_pass http://localhost:8080/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
In your case, I think that the proxy_path must indicate the real port (9002 in your case), but the $http_upgrade
sounds fine for a 505
error too ;)