currently I am using a django
backend which makes another post request
to a expressjs
backend. I have tested in development server and local machine, worked the request
was made perfectly. So I push it to production which does not work at all.
then I see there's this error TypeError: SSLError(CertificateError("hostname 's.com' doesn't match 'f.com'",)
which is weird. f.com
is in the same server instance
in s.com
but their server block config is separated though.
Currently using let's encrypt certbot
for these two domains.
Why would this be happening and anyhow I can track down more how is this happening?
Thanks in advance for any help.
in my /etc/nginx/sites-available
I have a file for s.com
and f.com
as for f.com
here is my config
server {
client_max_body_size 100M;
listen 80;
server_name f.com;
location / {
proxy_pass http://localhost:3005;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/f.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/f.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
if ($scheme != "https") {
return 301 https://$host$request_uri;
} # managed by Certbot
}
as for s.com
here is my config
server {
listen 80;
server_name s.com;
location / {
proxy_pass http://localhost:3006;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
# deny all;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/s.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/s.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
# Redirect non-https traffic to https
if ($scheme != "https") {
return 301 https://$host$request_uri;
} # managed by Certbot
}
0 Answers