4.1 KiB
| title | aliases | tags | sources | created | updated | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Apache ProxyPass Silently Ignored in Include Files |
|
|
|
2026-04-29 | 2026-04-30 |
Apache ProxyPass Silently Ignored in Include Files
On optical-dev.oliver.solutions, ProxyPass / ProxyPassReverse directives inside <Location> blocks placed in Apache include files (/etc/apache2/sites-available/includes/) are silently ignored — no error, proxy just doesn't work. Discovered after a long debugging session migrating video-accessibility from ai-sandbox to optical-dev.
Key Points
ProxyPassinside<Location>in anIncluded fragment file does NOT take effect on this server- The failure is completely silent — Apache loads the config without error, but requests are not proxied
- Confirmed on two projects (video-accessibility and barclays) — same outcome
- Fix: add
ProxyPassdirectives directly to the main vhost file - Standard inline
<Location>blocks inIncludefragments (for aliases, rewrites) still work fine — onlyProxyPassis affected
Details
The Pattern That Fails
# /etc/apache2/sites-available/includes/video-accessibility.conf
# (loaded via Include in the main vhost)
<Location /video-accessibility/api/>
ProxyPass http://127.0.0.1:8042/api/
ProxyPassReverse http://127.0.0.1:8042/api/
</Location>
Despite the file being included and Apache reloading cleanly (configtest OK), requests to /video-accessibility/api/ are not forwarded to the backend.
The Fix
Add ProxyPass blocks directly to the main vhost file:
# /etc/apache2/sites-available/optical-dev.oliver.solutions.conf
<VirtualHost *:443>
...
# Inline — ProxyPass works here
ProxyPass /video-accessibility/api/ http://127.0.0.1:8042/api/
ProxyPassReverse /video-accessibility/api/ http://127.0.0.1:8042/api/
Include /opt/video-accessibility/deploy/apache-video-accessibility.conf
</VirtualHost>
The Include fragment can still handle Alias, <Directory>, RewriteRule — only ProxyPass must live in the main file.
Diagnosis Approach
If a new project proxy suddenly stops working after migration to optical-dev:
- Check if
ProxyPassis inside an Include fragment - Move it to the main vhost file
sudo apache2ctl configtest && sudo systemctl reload apache2
Missing Include File Silently Stops Config Processing
A related but distinct failure mode: if an Include directive references a file that does not exist, Apache does NOT raise an error at configtest — it just silently aborts processing all directives below that line at runtime.
Behaviour
Include /opt/video-accessibility/deploy/apache-video-accessibility.conf
# ↑ If this file doesn't exist on disk:
# - apachectl configtest → "Syntax OK" (no error)
# - All directives below this line are NOT active at runtime
# - ProxyPass rules added after this Include are silently ignored
Why configtest Passes
apachectl configtest validates Apache config syntax — it does not verify that included file paths actually exist. The missing file becomes a runtime issue, not a syntax issue.
Diagnosis
If ProxyPass rules added to the main vhost file are not working:
- Check the order of
Includestatements above your new rules - Verify each included file actually exists:
ls /opt/<project>/deploy/<file>.conf - If a file is missing, either create it (can be empty) or remove the broken Include
sudo apache2ctl configtest && sudo systemctl reload apache2
This is different from the primary issue above (ProxyPass inside Include being ignored even when the file exists) — here the Include file itself is absent.
Related Concepts
- wiki/architecture/optical-dev-server-deploy — full optical-dev Apache pattern, port table, deploy scripts
- wiki/connections/optical-dev-apache-vite-basepath — SPA basePath + Apache ProxyPass connection
- wiki/concepts/apache-mod-alias-proxy-priority — another Apache silent failure: mod_alias winning over mod_proxy