<p>No, you can't specify port numbers in DNS records.</p>
<p>It must be the reverse proxy which listens on ports 80 and 443 (not BTCPay Server). The reverse proxy should pass traffic to BTCPay Server or your website based on the domain (btcpay.example.com vs example.com).</p>
<p>It is certainly possible to achieve that with BTCPay Server but I am not sure how easily or is it well supported setup to have &quot;two things&quot; on the same server.</p>

CC BY-SA 4.0
2021-06-29T15:43:57.237Z
Hi CypherpunkDev, your answer post was flagged as spam (which I think is a little too harsh), but you could rephrase the last sentence to explicitly disclaim that it is your project, but also point out that it's opensource (afaict).
Murch
CC BY-SA 4.0
2021-06-29T22:16:59.587Z
I removed the last sentence to avoid controversy.
CypherpunkDev
CC BY-SA 4.0
2021-06-29T22:58:54.370Z
Thank you for your understanding, and thank you for your contributions, I've been seeing your name pop up often lately! Welcome to Bitcoin Stackexchange.
Murch
CC BY-SA 4.0
2021-06-25T09:59:18.443Z
2021-06-29T22:16:42.290Z
2021-06-29T22:16:42.290Z
CypherpunkDev
<p>For better context: <a href="https://stackoverflow.com/questions/63123652/is-there-a-way-to-set-port-in-a-dns-forward">https://stackoverflow.com/questions/63123652/is-there-a-way-to-set-port-in-a-dns-forward</a></p>
<p>Hello community! I have setup an aws ec2 instance and installed BTCPay server on it. I used the Docker version.</p>
<p>I also bought a domain name and pointed <code>btcpay.example.com</code> to my BTCPay server with an A record.</p>
<p>I want to run a Web server along side BTCPay server at <code>example.com</code>. BTCPay Server has already taken up port 80 and 443 so I guess I'll have to run my web server on another port but how can I specify port number in a DNS record?</p>
<p>With some help I learnt about reverse proxy and I see BTCPay server has an environment variable called <code>&quot;REVERSEPROXY_DEFAULT_HOST: Optional, if using a reverse proxy nginx, specify which website should be presented if the server is accessed by its IP.&quot;</code> though I don't understand how to configure this or if its the correct way.</p>
<p>Help please?</p>

<server><port><dns><amazon-web-services><btcpay>
Using BTCPay Server along with a web server in a single machine
ParmuTownley
# Using BTCPay Server along with a web server in a single machine

(Asked by: username_0 on 2020-07-28)

For better context: <https://stackoverflow.com/questions/63123652/is-there-a-way-to-set-port-in-a-dns-forward>

Hello community! I have setup an aws ec2 instance and installed BTCPay server on it. I used the Docker version.

I also bought a domain name and pointed `btcpay.example.com` to my BTCPay server with an A record.

I want to run a Web server along side BTCPay server at `example.com`. BTCPay Server has already taken up port 80 and 443 so I guess I'll have to run my web server on another port but how can I specify port number in a DNS record?

With some help I learnt about reverse proxy and I see BTCPay server has an environment variable called `"REVERSEPROXY_DEFAULT_HOST: Optional, if using a reverse proxy nginx, specify which website should be presented if the server is accessed by its IP."` though I don't understand how to configure this or if its the correct way.

Help please?

**Tags:** server, port, dns, amazon-web-services, btcpay


---

## 1 answers

### Answer by username_1 on 2021-06-25. Score: 1

No, you can't specify port numbers in DNS records.

It must be the reverse proxy which listens on ports 80 and 443 (not BTCPay Server). The reverse proxy should pass traffic to BTCPay Server or your website based on the domain (btcpay.example.com vs example.com).

It is certainly possible to achieve that with BTCPay Server but I am not sure how easily or is it well supported setup to have "two things" on the same server.

> **Comments:**
> **username_2**: Hi username_1, your answer post was flagged as spam (which I think is a little too harsh), but you could rephrase the last sentence to explicitly disclaim that it is your project, but also point out that it's opensource (afaict).  
> **username_1**: I removed the last sentence to avoid controversy.  
> **username_2**: Thank you for your understanding, and thank you for your contributions, I've been seeing your name pop up often lately! Welcome to Bitcoin Stackexchange.  

---

