server {
        # 301 redirect users to an encrypted version of the page
        # Change example.com to the domain where podcast-generator will be running
        # You need to disable this and change the line "listen 443 ssl" in the following block to "listen 80" if you wish an unencrypted only page
        listen 80;
        server_name example.com;
        return 301 https://$host$request_uri;
}

server {
        # Main server block config
        # Change example.com to the domain where podcast-generator will be running
        listen 443 ssl;
        server_name example.com;

        # Set nginx max_body_size attribute to 1 GB to prevent php timeout errors
        # This is necessary so the upload in the admin panel works reliably
        client_max_body_size 1G;

        location / {
                # Change your document root accordingly
                root /var/www/html;
                index index.php;

                # Set proxy_read_timeout attribute to 1 hour
                # Prevents nginx from reinitiating the server connection because it thinks PHP is timing out
                proxy_read_timeout 3600;

                # default PHP enable snipped - change according to the configuration your OS uses
                location ~ \.php$ {
                        include snippets/fastcgi-php.conf;
                        fastcgi_split_path_info ^(.+\.php)(/.+)$;
                        include fastcgi_params;
                        fastcgi_param SCRIPT_FILENAME $request_filename;
                        fastcgi_pass unix:/run/php/php8.1-fpm.sock;
                }
        }
}