【问题标题】:Pgadmin4: Invalid HTTP Version 'Invalid HTTP Version: 'on postgres@domain.tld HTTP/1.0''Pgadmin4:无效的 HTTP 版本'无效的 HTTP 版本:'在 postgres@domain.tld HTTP/1.0''
【发布时间】:2019-02-07 06:00:11
【问题描述】:
--------------------------------------------------------
| Pgadmin version           |          4.3.5           |
--------------------------------------------------------
| PostgreSQL server version | pg_ctl (PostgreSQL) 11.1 |
--------------------------------------------------------
| Docker image              |      dpage/pgadmin4      |
--------------------------------------------------------

我在 Docker 容器中使用 PGAdmin4 时遇到了问题。当我连接到主机的机器 postgresql 服务器并尝试查看/编辑数据时 - 我收到这样的错误:https://pasteboard.co/HO1w7jS.png

注意:

  • 我有默认的 postgresql 配置,listen_addresses = '127.0.0.1, 172.17.0.1 除外。
  • PGAdmin 容器位于 nginx 代理 mydomain.tld -> localhost:5050 后面

据我了解,这是 postgresql HTTP API 的问题。但我不是 postgresql 和 pgadmin 方面的专家。也许有人有这个问题的解决方案?

【问题讨论】:

  • 我看到了类似的问题。你找到解决办法了吗?
  • @psychemedia 是的。查看答案

标签: postgresql docker pgadmin pgadmin-4


【解决方案1】:

问题出在 nginx 位置的正则表达式中。 Nginx 莫名其妙地截断了 URL 参数。

也许这是由于使用了这个补丁:https://stackoverflow.com/a/50515636/9547899(我用它来将请求重定向到 pgadmin 到一个子目录)

原来是:

location ~ /PostgreSQL(.*)$ {
    proxy_pass          http://127.0.0.1:23301$1;

变成了:

location ~ PostgreSQL {
    proxy_pass          http://127.0.0.1:23301;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-09-10
    • 2015-02-13
    • 1970-01-01
    • 1970-01-01
    • 2014-05-22
    • 2016-06-01
    • 1970-01-01
    相关资源
    最近更新 更多