Files
local-transcription/server/php/.htaccess
Josh Knapp 2870d45bdc Add Apache ProxyTimeout configuration for SSE support
Created apache-sse-config.conf with required Apache settings to support
long-running SSE connections. Apache's mod_proxy_fcgi has a default
timeout of 30-60 seconds which kills SSE connections prematurely.

The configuration sets ProxyTimeout to 21600 seconds (6 hours) to match
HAProxy's timeout and allow long streaming sessions.

Added note to .htaccess explaining this requirement, as ProxyTimeout
cannot be set in .htaccess and must be configured in the virtual host.

To fix 504 Gateway Timeout errors:
1. Add ProxyTimeout directive to Apache virtual host config
2. Reload Apache
3. Test SSE connection

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-26 15:29:56 -08:00

34 lines
1.1 KiB
ApacheConf

# 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)
<Files "config.php">
Require all denied
</Files>
# Deny access to .json data files
<FilesMatch "\.json$">
Require all denied
</FilesMatch>
# Disable directory listing
Options -Indexes
# Enable compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/json
</IfModule>
# Set MIME types
AddType application/json .json
AddType text/event-stream .php
# NOTE: PHP settings (display_errors, upload limits) must be configured in:
# - For php-fpm: /etc/php/X.X/fpm/pool.d/www.conf or php.ini
# - For mod_php: Can use php_flag/php_value directives here