如何将请求发送到Apache2中的两个进程?

发布于 2025-02-12 15:51:00 字数 196 浏览 0 评论 0原文

我有两台服务器,我创建了一个自定义的锈服务器,收听端口4848,以及一个以3000的方式收听的Gitea服务器。如果我直接输入IP和端口,我可以连接到这两种情况,但显然这不是理想的。我如何将 *.domain.exmaple指向该过程4848,gitea.domain.domain.example在3000中?

我正在使用Ubuntu 22

谢谢!

I got two servers, a custom Rust server I've created, listening to port 4848, and a Gitea server listening at 3000. I can connect to both of these just fine if I input the IP and port directly, but obviously this is not ideal. How can I direct *.domain.exmaple to the process at 4848, and gitea.domain.example at 3000?

I'm using Ubuntu 22

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沫雨熙 2025-02-19 15:51:00

最终设法找到了解决方案。我将主配置文件编辑给了

<VirtualHost *:80>
    ServerAdmin admin@email
    ServerName gitea.domain.example
    ProxyPreserveHost On
    # setup the proxy
    <Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>
    ProxyPass / http://localhost:3000/
    ProxyPassReverse / http://localhost:3000/
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin admin@email
    ServerName domain.example
    ServerAlias *.domain.example
    ProxyPreserveHost On
    # setup the proxy
    <Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>
    ProxyPass / http://localhost:4848/
    ProxyPassReverse / http://localhost:4848/
</VirtualHost>

Finally managed to find a solution. I edited my main configuration file to this

<VirtualHost *:80>
    ServerAdmin admin@email
    ServerName gitea.domain.example
    ProxyPreserveHost On
    # setup the proxy
    <Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>
    ProxyPass / http://localhost:3000/
    ProxyPassReverse / http://localhost:3000/
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin admin@email
    ServerName domain.example
    ServerAlias *.domain.example
    ProxyPreserveHost On
    # setup the proxy
    <Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>
    ProxyPass / http://localhost:4848/
    ProxyPassReverse / http://localhost:4848/
</VirtualHost>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文