# storybook.dss.overbits.luz.uy - Nginx Configuration
# Created: 2025-12-05
# Owner: overbits
# Description: Storybook - Component documentation and testing
# Port: 6006

server {
    server_name storybook.dss.overbits.luz.uy;

    access_log /var/log/nginx/storybook_dss_overbits_luz_uy_access.log;
    error_log /var/log/nginx/storybook_dss_overbits_luz_uy_error.log;

    location / {
        proxy_pass http://127.0.0.1:6006;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        proxy_connect_timeout 60s;
        proxy_send_timeout 60s;
        proxy_read_timeout 60s;
    }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/dss.overbits.luz.uy/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/dss.overbits.luz.uy/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 = storybook.dss.overbits.luz.uy) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    server_name storybook.dss.overbits.luz.uy;

    listen 80;
    return 404; # managed by Certbot


}
