Mongo图表在nginx后面

huangapple go评论78阅读模式
英文:

Mongo chart behind nginx

问题

我有一个从 "quay.io/mongodb/charts:19.12.1" 创建的 Docker 容器,用于 MongoDB 图表。

我在 Nginx 中有以下配置

location /mongo/chart/ {
    proxy_pass "http://intenal.nosql.chart/";
}

现在,如果我从 http://mypublicdomain.com/mongo/chart 访问我的图表,它不起作用。似乎与 baseURL 有关的错误。

那么,在 MongoDB 图表中应该做什么来使用不同的 baseURL?

英文:

I have docker container created from "quay.io/mongodb/charts:19.12.1" for mongodb chart.

I have below configuration in nginx

location /mongo/chart/ {
    proxy_pass "http://intenal.nosql.chart/";
}

Now if i access my chart from http://mypublicdomain.com/mongo/chart, it is not working. it seems there is error related to baseurl.

So what should i do in mongodb chart to take difference base url

答案1

得分: 2

我必须在nginx中添加以下头部:

location / {
    proxy_pass http://intenal.nosql.chart/;
    proxy_set_header Host $host:$server_port; 
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}
英文:

I have to add following header in ngnix

location / {
                proxy_pass http://intenal.nosql.chart/;
                proxy_set_header Host $host:$server_port; 
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
}

huangapple
  • 本文由 发表于 2020年1月3日 13:44:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/59573718.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定