I serve two sites with Nginx. The first site (for example, A) has an SSL certificate, and the second site (say B) is not. Site A works great when opened on https and B via http. But when I access site B on https, nginx serves the SSL certificate and the contents of site A with domain B, which should not be.
The Nginx configuration for site A is as follows. For site B, this is just a reverse proxy for the Flask application.
server { listen 80; server_name siteA.com; return 301 https://$host$request_uri; } server { listen 443 ssl; server_name siteA.com; ssl_certificate /path/to/cert.cert ssl_certificate_key /path/to/cert_key.key; ssl_prefer_server_ciphers on; ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:RC4-SHA:AES256-GCM-SHA384:AES256-SHA256:CAMELLIA256-SHA:ECDHE-RSA-AES128-SHA:AES128-GCM-SHA256:AES128-SHA256:AES128-SHA:CAMELLIA128-SHA; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; keepalive_timeout 70;
I cannot understand what is wrong here.
source share