Currently Nginx is configured so that it accepts a wildcard SSL certificate for domain ex: *.website.com.
Instead of buying an expensive wildcard certificate I bought a single domain SSL certificate for the top domain website.com
Now, I found out that the service actually uses two subdomains that also need to be under SSL.
ex: a.website.com and b.website.com
Question.
How do I change the nginx configuration so that when I buy a single subdomain SSL certificate for a.website.com I can point nginx to use it.
Here is what the Nginx file currently looks like:
server {
listen 80;
server_name website.io www.website.io;
return 301 https://website.io$request_uri;
}
server {
listen 443 ssl;
ssl on;
server_name website.io www.website.io;
client_max_body_size 5m;
add_header X-UA-Compatible "IE=Edge,chrome=1";
access_log /var/log/nginx/website.io_access.log;
error_log /var/log/nginx/website.io_error.log;
ssl_certificate /srv/ssl/website.io/ssl.crt;
ssl_certificate_key /srv/ssl/website.io/ssl.key;
error_page 500 502 503 504 /500.html;
location /500.html {
root /srv/static/website/maintenance;
}
location / {
#auth_basic "Restricted";
#auth_basic_user_file /etc/nginx/htpasswd.conf;
include uwsgi_params;
uwsgi_connect_timeout 30;
uwsgi_read_timeout 30;
uwsgi_pass 127.0.0.4:3031;
}
}
a.example.com