【问题标题】:how to virtualhost with podman如何使用 podman 进行虚拟主机
【发布时间】:2020-05-07 03:39:52
【问题描述】:

我的服务器在 podman 中运行 gitlab。

我想要 gitlab 连接子域。

测试命令

podman start gitlab-ce --VIRTUAL-HOST=test.example.com -p 80 

如何在 podman 中设置 virtualHost?

【问题讨论】:

    标签: networking centos gitlab-ce podman


    【解决方案1】:

    根据GitLab documentation,容器可以启动:

    sudo podman run --detach \
      --hostname gitlab.example.com \
      --env GITLAB_OMNIBUS_CONFIG="external_url 'http://test.example.com/';" \
      --publish 443:443 --publish 80:80 \
      --name gitlab \
      --restart always \
      gitlab/gitlab-ce:latest
    

    需要sudo绑定80和443端口。

    【讨论】:

    • 我的服务器有很多服务。我想要 80 端口没有 gitlab。因为我的服务使用 80 端口。 example1.test.com 连接我的服务 exalple2.test.com 连接我的服务 2
    • 然后你需要在你的服务前面配置一个反向代理(例如traefikhaproxynginx)。这不是您可以使用 GitLab 图像解决的问题。
    猜你喜欢
    • 2018-06-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-17
    • 2020-07-17
    • 2013-04-04
    • 1970-01-01
    相关资源
    最近更新 更多