calamari
calamari copied to clipboard
calamari 1.4 branch: modify httpd to be reverse proxy instead of WSGI host
Since 1.4, the REST API WSGI application is hosted by calamari-lite at localhost:8002. Should httpd should be configured as a reverse proxy instead of wsgi host?
I think USE_X_FORWARDED_HOST = True may be necessary in calamari_web settings.py for rewriting of absolute URLs.
Something like (for all static assets):
Alias /static /opt/calamari/webapp/content/
<Location "/static/">
ProxyPass "!"
<IfVersion >= 2.4>
Require all granted
</IfVersion>
SetHandler None
</Location>
### repeat for all static assets
### proxy to calamari-lite's gevent pywsgi application
### Option to disable SSL?
<Location "/">
<IfVersion >= 2.4>
Require all granted
</IfVersion>
ProxyPass "https://localhost:8002/"
ProxyPassReverse "https://localhost:8002/"
SetHandler None
</Location>
For Django: calamari_web/settings.py
USE_X_FORWARDED_HOST = True
If this is correct, I will submit a PR.
@aalba6675 We dropped apache as a requirement in 1.4 so there's currently nothing sitting in front of our service. This might be a nice addition to consider as optional config.