My current stack has Varnish -> NGINX (2 servers) running Drupal -> MySql.
All static content is cached and served by Varnish over HTTP. However when a user signs-up and wants to purchase a plan the connection to the payment gateway is over HTTPS. Currently the certificate is implemented on one of the NGINX servers. The A record of the domain points to this NGINX server.
I intend to point the A record of the domain to the Varnish server so that I can benefit from Varnish's caching instead of loading the NGINX server. Any visitor who intends to purchase will be passed through to NGINX. I have two doubts
- Should I generate another certificate for the second NGINX server or just implementing the certificate that's available on first server onto the second one suffice?
- Will this setup cause any problems? I get this feeling because the server(s) that contains the certificate no longer has the domain mapped to it.
EDIT: I intend to have Varnish listen on port 443 and make it pass all HTTPS requests to the NGINX server