server {
    ##
    # Aquí va el nombre del servidor
    ##
    server_name calibre.reymota.es;

    location / {
        ##
        # El puerto tiene que ser el del servicio por el que la aplicación escucha
	##
        proxy_pass http://127.0.0.1:30830/;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        client_max_body_size 64M;
        proxy_read_timeout 300s;
    }


    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/calibre.reymota.es/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/calibre.reymota.es/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 {
    if ($host = calibre.reymota.es) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    server_name calibre.reymota.es;
    listen 80;
    return 404; # managed by Certbot


}