Okay so I have nginx config that looks something like this:
server {
root /var/www/frontend/dist;
index index.html index.htm index.nginx-debian.html;
server_name bankofsoftware.com www.bankofsoftware.com;
location / {
try_files $uri $uri/ =404;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/bankofsoftware.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/bankofsoftware.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
}
server
{
listen 80;
listen [::]:80;
server_name app.bankofsoftware.com www.app.bankofsoftware.com;
location / {
proxy_pass http://localhost:3000;
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;
}
}
server {
if ($host = www.bankofsoftware.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = bankofsoftware.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80 default_server;
listen [::]:80 default_server;
server_name bankofsoftware.com www.bankofsoftware.com;
return 404; # managed by Certbot
}
As you can see, I have another server block for my app subdomain. Now my questions is can I run the same certbot command (just replace the domain parameters with my subdomain) and will nginx just add stuff to my cofig or what should I do in order to get it to work too ?