diff --git a/server/php/.htaccess b/server/php/.htaccess index 709dee9..2c6d509 100644 --- a/server/php/.htaccess +++ b/server/php/.htaccess @@ -1,6 +1,11 @@ # Security settings for Multi-User Transcription Server # Compatible with both mod_php and php-fpm +# IMPORTANT: For Server-Sent Events (SSE) to work with php-fpm, you MUST configure +# Apache's ProxyTimeout in your virtual host configuration. See apache-sse-config.conf +# for the required settings. Without this, Apache will timeout SSE connections after +# 30-60 seconds with a 504 Gateway Timeout error. + # Deny access to config file directly (if accessed via URL) Require all denied diff --git a/server/php/apache-sse-config.conf b/server/php/apache-sse-config.conf new file mode 100644 index 0000000..e1f18e5 --- /dev/null +++ b/server/php/apache-sse-config.conf @@ -0,0 +1,20 @@ +# Apache configuration snippet for Server-Sent Events (SSE) support +# Add this to your Apache virtual host configuration +# +# Location: Typically in /etc/apache2/sites-available/your-site.conf +# or wherever your virtual host is configured + +# Increase timeout for SSE connections (6 hours to match HAProxy) +# This prevents Apache from killing long-running SSE connections +ProxyTimeout 21600 + +# Alternative: Set timeout specifically for SSE endpoints +# Uncomment and adjust the path if you want to be more specific +# +# ProxyTimeout 21600 +# + +# Note: After adding this to your virtual host config, reload Apache: +# sudo systemctl reload apache2 +# or +# sudo service apache2 reload