# 如何将Discourse的端口80和443更改为其他端口

**URL:** <https://meta.discourse.org/t/how-to-change-discourse-port-80-and-443-to-another-port/305587>\
**Category:** Self-hosting\
**Created:** [2024年四月26日 15:25 UTC](https://meta.discourse.org/t/how-to-change-discourse-port-80-and-443-to-another-port/305587 "2024-04-26T15:25:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkamranmazhar](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@mkamranmazhar](https://meta.discourse.org/u/mkamranmazhar)\
**Post date:** [2024年四月26日 15:25 UTC](https://meta.discourse.org/t/how-to-change-discourse-port-80-and-443-to-another-port/305587/1 "2024-04-26T15:25:30Z")

</div>

大家好，

我目前在 Ubuntu 20.04 64 位系统上运行 aaPanel 版本 6.8.36，Nginx 运行在 80 端口。我想在同一台服务器上安装 Discourse，但由于 80 端口已被 Nginx 占用，因此我需要在初始设置之前获取关于配置 Discourse Docker 的指导。

 ![nginx](https://global.discourse-cdn.com/meta/original/4X/4/5/9/459d45df72a4d3a8cad3b079995fad7628874cc4.png)

任何关于如何处理端口冲突和正确配置 Discourse 的帮助都将不胜感激。

提前致谢！

---

<div class="post-metadata">

**Author:** ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)\
**Post date:** [2024年四月26日 18:44 UTC](https://meta.discourse.org/t/how-to-change-discourse-port-80-and-443-to-another-port/305587/2 "2024-04-26T18:44:16Z")

</div>

我相信这个主题应该包含您需要的所有答案：

> [@Run other websites on the same machine as Discourse](https://meta.discourse.org/t/run-other-websites-on-the-same-machine-as-discourse/17247):
>
> @pfaffman edited this heavily 2022.02.24. Blame me if it’s broken. If you want to run other websites on the same machine as Discourse, you need to set up an extra NGINX or HAProxy proxy in front of the Docker container. NOTE: This is for advanced admins This guide assumes you already have Discourse working - if you don’t, it may be hard to tell whether or not the configuration is working. You cannot use ./discourse-setup to set up Discourse if another server is using port 80 or 443. You will …

---

<div class="post-metadata">

**Author:** ![mkamranmazhar](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@mkamranmazhar](https://meta.discourse.org/u/mkamranmazhar)\
**Post date:** [2024年五月2日 05:31 UTC](https://meta.discourse.org/t/how-to-change-discourse-port-80-and-443-to-another-port/305587/3 "2024-05-02T05:31:25Z")

</div>

我真的很感谢这个参考。我已经成功修复并安装了 Discourse。
