Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

2 domains with 2 certificates, 1 public IP, 1 nginx server

$
0
0
Hello all,

I hope you can help me out here because I cannot figure out why this is happening. I have the following 2 domains:

alpha.com
beta.com

they both pointing to same server IP:

x.x.x.x

I have a single nginx running on this server. On my firewall, i have ports 80 and 443 forwarded to this server's internal IP;

192.168.1.2

both of the domains have their own certificates.

Here are the server configuration for both of these domains:

alpha.com: http://pastebin.com/u9absNMe
beta.com: http://pastebin.com/m7dV2cqk

Problem: The problem here is that when I go to alpha.com, the sever redirects me to https://alpha.com and loads the content of alpha.com, so far it's great. When i open a new tab on my browser and type beta.com, the url on my browser changes to https://beta.com but loads the content of alpha.com.

How would I tell nginx to server the right directory for each domain based on which URL was typed in the browser and still keep the https?

Thanks.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>