# 既存の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 日午前 9: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:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![MayusYT](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mayusyt/32/154210_2.png) [@MayusYT](https://meta.discourse.org/u/MayusYT)
#### Post date: [2019 年 1 月 27 日午前 9:45 UTC](https://meta.discourse.org/t/need-some-assistance-for-setting-up-a-subdomain-when-there-is-already-a-webserver/107639/1 "2019-01-27T09:45:20Z")

</div>

Hi!

I just bought a domain at [Namecheap.com](http://Namecheap.com).  
I have a server with just one IP and I would like to run Discourse on the port 8080 as 80 is already occupied by my website.  
When I want to setup an A record for discourse with the port 8080, namecheap says that it’s not a valid IP adress.

 ![Capture](https://global.discourse-cdn.com/meta/original/3X/a/f/af2d2b0fbe45eea48b3db5de3a0ab44b48ba1aa6.png)

Any help is highly appreciated!

---

<div class="post-metadata">

### Author: ![uwe\_keim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/uwe_keim/32/326762_2.png) [@uwe\_keim](https://meta.discourse.org/u/uwe_keim)
#### Post date: [2019 年 1 月 27 日午前 10:04 UTC](https://meta.discourse.org/t/need-some-assistance-for-setting-up-a-subdomain-when-there-is-already-a-webserver/107639/2 "2019-01-27T10:04:29Z")

</div>

Ports are completely out-of-scope in terms of DNS.

DNS maps names to IP addresses.

> **[Domain Name System](https://en.wikipedia.org/wiki/Domain_Name_System)**
>
> The Domain Name System (DNS) is a hierarchical and distributed name service that provides a naming system for computers, services, and other resources on the Internet or other Internet Protocol (IP) networks. It associates various information with domain names (identification strings) assigned to each of the associated entities. Most prominently, it translates readily memorized domain names to the numerical IP addresses needed for locating and identifying computer services and devices with the ...

Port associations is done on your server, not in the DNS.

---

<div class="post-metadata">

### Author: ![MayusYT](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mayusyt/32/154210_2.png) [@MayusYT](https://meta.discourse.org/u/MayusYT)
#### Post date: [2019 年 1 月 27 日午前 10:05 UTC](https://meta.discourse.org/t/need-some-assistance-for-setting-up-a-subdomain-when-there-is-already-a-webserver/107639/3 "2019-01-27T10:05:39Z")

</div>

So what should I use instead in this case?

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [2019 年 1 月 27 日午前 10:22 UTC](https://meta.discourse.org/t/need-some-assistance-for-setting-up-a-subdomain-when-there-is-already-a-webserver/107639/4 "2019-01-27T10:22:28Z")

</div>

You’re putting yourself in a very complex territory.

What I can suggest is to run discourse on a subdomain or in a subdirectory.

---

<div class="post-metadata">

### Author: ![MayusYT](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mayusyt/32/154210_2.png) [@MayusYT](https://meta.discourse.org/u/MayusYT)
#### Post date: [2019 年 1 月 27 日午前 10:23 UTC](https://meta.discourse.org/t/need-some-assistance-for-setting-up-a-subdomain-when-there-is-already-a-webserver/107639/5 "2019-01-27T10:23:32Z")

</div>

Yeah, I want to run it on a subdomain! But I don’t know how to tell my nginx proxy that you’re coming from the subdomain.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [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.

---

<div class="post-metadata">

### Author: ![MayusYT](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mayusyt/32/154210_2.png) [@MayusYT](https://meta.discourse.org/u/MayusYT)
#### Post date: [2019 年 1 月 27 日午前 10:26 UTC](https://meta.discourse.org/t/need-some-assistance-for-setting-up-a-subdomain-when-there-is-already-a-webserver/107639/7 "2019-01-27T10:26:12Z")

</div>

ooooh! Didn’t think of that! Thank you so much!

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2019 年 2 月 26 日午前 10:26 UTC](https://meta.discourse.org/t/need-some-assistance-for-setting-up-a-subdomain-when-there-is-already-a-webserver/107639/8 "2019-02-26T10:26:33Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
