0

I have a website with domain example.com in a server with IP x.x.x.x. It runs with Nginx and Let's Encrypt very well, which is located in /var/www/app1. The domain is obtained and managed via a providerXYZ.

Last time I can deploy a web application which I installed in the same server in /var/www/app2 as a subdomain of my example.com, so that I can access it with myapp1.example.com. I can configure the A record of the DNF in my providerXYZ to add a subdomain and write a new server block in Nginx with server name myapp1.example.com.

Now, I installed my nextcloud in another server with ip y.y.y.y, which is located in /var/www/nextcloud. How can I configure my DNS and Nginx to access my nextcloud via mycloud.example.com? The problem what I'm facing now is that I cannot start the nextcloud in the server IP y.y.y.y, since it needs a server name, root and SSL cert path in the Nginx configuration file. Instead, I think I have to write server block in my Nginx configuration file of the server x.x.x.x. But I don't know how to write a server block which root in another server y.y.y.y.

If such a way is not possible, I can buy a new domain to assign it for my nexcloud in the new server y.y.y.y. I just don't want to have many domain names.

Thanks in advanced.

ywiyogo
  • 121
  • 4
  • If A record for `mycloud.example.com` points to server `y.y.y.y` then Nginx on server `x.x.x.x` is not involved at all. – Richard Smith Nov 23 '19 at 18:36
  • Thanks Richard! So if my Nginx conf on server y.y.y.y define the server_name as `mycloud.example.com`. Then how can I configure the DNS for example on my namecheap configuration [here](https://www.namecheap.com/support/knowledgebase/article.aspx/9776/2237/how-to-create-a-subdomain-for-my-domain)? I can assign an A record for `myapp1` subdomain easily since it has the same IP address. Assigning a new A record `mycloud` on the domain example.com with value of y.y.y.y doesn't work. – ywiyogo Nov 23 '19 at 23:39
  • Any DNS change can take hours to propagate. Is that the issue you're seeing? – Richard Smith Nov 24 '19 at 07:45
  • Ok, I'll check with a simple index.html first. It can be that my nextcloud is not configured correctly. – ywiyogo Nov 24 '19 at 20:53
  • Thanks Richard! My issue was the DNS configuration. Due to mesh network the assigned IPv4 doesn't work, since several computer in my network have the same IPv4. Changing the A record to AAAA record solves the issue. Then, I need only a correct Nginx config on my server y.y.y.y – ywiyogo Nov 25 '19 at 21:18

0 Answers0