# Nginx serving the wrong certificate

**URL:** <https://forum.infinityfree.com/t/nginx-serving-the-wrong-certificate/116005>\
**Category:** Informal\
**Created:** [October 11, 2025, 11:21pm UTC](https://forum.infinityfree.com/t/nginx-serving-the-wrong-certificate/116005 "2025-10-11T23:21:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![EvelynOctavia](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/evelynoctavia/32/68233_2.png) [@EvelynOctavia](https://forum.infinityfree.com/u/EvelynOctavia)\
**Post date:** [October 11, 2025, 11:21pm UTC](https://forum.infinityfree.com/t/nginx-serving-the-wrong-certificate/116005/1 "2025-10-11T23:21:38Z")

</div>

also posted in [cloudflare forum](https://community.cloudflare.com/t/nginx-serving-wrong-certificate/846126/1) and [nginx forum](https://community.nginx.org/t/nginx-serves-the-wrong-certificate/7496/1) (both posts are hidden.)

I’m running nginx in a docker container with `/etc/letsencrypt` on the host mounted to `/etc/letsencrypt` on the container. I have two virtual hosts, `7.tiffany.eu.org` and `tranzhex.net`. i issued an LE certificate on `7.tiffany.eu.org`, it works fine. but i have cloudflare origin ca on `tranzhex.net`, it just won’t work. checking with `openssl s_client` command, nginx keeps sending `7.tiffany.eu.org`’s certificate instead of `tranzhex.net`’s cloudflare certificate. the configuration i have, seen on `nginx -T`

```auto
# configuration file /etc/nginx/conf.d/critter.conf:
server {
server_name 7.tiffany.eu.org;
server_name 2a12-5e40-1-6dff-c13f-fe36-19c3-e562.sslip.io;
server_name 91-239-208-63.sslip.io;
server_name 91-239-208-63.nip.io;
server_name 5befd03f.nip.io;
server_name 91.239.208.63.16clouds.com;
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
ssl_certificate /etc/letsencrypt/live/7.tiffany.eu.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/7.tiffany.eu.org/privkey.pem;
root /var/www/html;
index index.htm;
add_header X-Robots-Tag noindex;
}
server {
server_name 7.tiffany.eu.org;
server_name 2a12-5e40-1-6dff-c13f-fe36-19c3-e562.sslip.io;
server_name 91-239-208-63.sslip.io;
server_name 91-239-208-63.nip.io;
server_name 5befd03f.nip.io;
server_name 91.239.208.63.16clouds.com;
listen 80;
listen [::]:80;
return 301 https://$host$request_uri;
}

# configuration file /etc/nginx/conf.d/default.conf:
server {
listen 443 ssl default_server;
server_name _;
ssl_certificate /etc/letsencrypt/cert.pem;
ssl_certificate_key /etc/letsencrypt/key.pem;
return 444;
}

# configuration file /etc/nginx/conf.d/tranz.conf:
server {
server_name tranzhex.net;
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
ssl_certificate /etc/letsencrypt/tranz.crt;
ssl_certificate_key /etc/letsencrypt/tranz.key;
location / {
proxy_pass http://feixiao;
}
location /guinaifen/ {
proxy_pass https://sushang:9443/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /live {
proxy_pass http://64.31.10.126:7024;
}
}

```

I just hope this forum’s automated spam filter doesn’t trip this one too..

---

<div class="post-metadata">

**Author:** ![Meishin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/meishin/32/59902_2.png) [@Meishin](https://forum.infinityfree.com/u/Meishin)\
**Post date:** [October 12, 2025, 12:30am UTC](https://forum.infinityfree.com/t/nginx-serving-the-wrong-certificate/116005/2 "2025-10-12T00:30:57Z")

</div>

Try decreasing the amount of starrail used in your configuration (jk) 🤣

The certificate and key supplied to `tranzhex.net` looks suspicious to me, it feels like a symlink as it’s not the regular certbot path, are you sure these are symlinked to the correct place?

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [October 27, 2025, 12:31am UTC](https://forum.infinityfree.com/t/nginx-serving-the-wrong-certificate/116005/3 "2025-10-27T00:31:02Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
