server {
    listen 80;
    server_name larablog.test;
    root /path/to/larablog/public;
    index index.php;

    client_max_body_size 32m;

    # Local attachments disk (ATTACHMENTS_DRIVER=local); production should use S3/R2.
    location /attachments-local/ {
        alias /path/to/larablog/storage/app/attachments/;
        access_log off;
    }

    # Legacy sablog pretty URLs (handled in Laravel routes/legacy.php as well)
    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
    }

    location ~* /\.(?!well-known).* {
        deny all;
    }
}
