server {
root /usr/share/nginx/html;
index index.html index.htm index.nginx-debian.html;
server_name _; # managed by Certbot
location / {
if ($host = hub.pena.digital) {
proxy_pass http://hub;
}
if ($host = docs.pena.digital) {
proxy_pass http://docs;
}
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/nginx/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/nginx/privkey.pem; # managed by Certbot
}
server {
listen 80 ;
listen [::]:80 ;
server_name _;
return 301 https://$host$request_uri;
}