Welcome! Log In Create A New Profile

Advanced

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

Posted by ajamali1 
2 domains with 2 certificates, 1 public IP, 1 nginx server
December 09, 2015 09:43PM
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.
Re: 2 domains with 2 certificates, 1 public IP, 1 nginx server
December 12, 2015 06:25AM
Both are defined as 'default', a default block is only used to capture anything not matched, so remove it from both.

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 158
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready