# 已有 Web 服务器时如何设置子域名，需要帮助

**URL:** <https://meta.discourse.org/t/need-some-assistance-for-setting-up-a-subdomain-when-there-is-already-a-webserver/107639>\
**Category:** Self-hosting\
**Created:** [2019 年1 月 27 日 09:45 UTC](https://meta.discourse.org/t/need-some-assistance-for-setting-up-a-subdomain-when-there-is-already-a-webserver/107639 "2019-01-27T09:45:20Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

作者： ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)\
发布日期： [2019 年1 月 27 日 10:25 UTC](https://meta.discourse.org/t/need-some-assistance-for-setting-up-a-subdomain-when-there-is-already-a-webserver/107639/6 "2019-01-27T10:25:45Z")

</div>

Create an A Record for s`ub.example.com` with the IP address where You host forum

Then in nginx proxy,

use `server_name sub.example.com;`  
And forward all requests to docker container running discourse.

---

_[View the full topic](https://meta.discourse.org/t/need-some-assistance-for-setting-up-a-subdomain-when-there-is-already-a-webserver/107639)._
