我已經使用https://datahubproject.io/docs/quickstart 中的步驟啟動了 datahub
然后用conf添加nginx
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;
}
在http://datahub.myhost.com:9002一切正常
但在 http://datahub.myhost.com
我有
Request URL: https://datahub.myhost.com/
Request Method: GET
Status Code: 505 HTTP Version Not Supported
我認為在 nginx 中設定的一些 cfg 可以解決這個問題。請幫忙
uj5u.com熱心網友回復:
這是我用于特定位置的配置,該位置針對我的公共服務器上的特定埠:
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;
}
在您的情況下,我認為 proxy_path 必須指示真實埠(在您的情況下為 9002),但$http_upgrade對于505錯誤來說聽起來也很好;)
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/315305.html
