2024-02-28 (Wednesday)
<Location /demo> RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME} RequestHeader set X-Forwarded-SSL expr=%{HTTPS} ProxyPass unix:/usr/local/www/example/data/demo.socket|http://example.com/demo ProxyPassReverse unix:/usr/local/www/example/data/demo.socket|http://example.com/demo </Location> The combination of the RequestHeader settings and the http://example.com/demo pseudo url passes all the necessary information to the backend so that request.url in a flask application shows up correctly as https://example.com/demo…
2020-09-04 (Friday)
When writing web applications, it is often necessary (or at least more aesthetic) to make the home page part of the application. Using mod_wsgi, this looks like this:
WSGIScriptAlias / /var/www/mysite/app/myapp/myapp/wsgi.py Static files can be exempted via aliases:
Alias /robots.txt /var/www/mysite/htdocs/robots.txt Alias /favicon.ico /var/www/mysite/htdocs/favicon.ico Alias /static/ /var/www/mysite/htdocs/static/ If you want to enable mod_status the normal approach doesn’t work:
<Location "/server-status"> SetHandler server-status· Require ip 192.0.2.0/24 </Location> /server-status will be passed to WSGI handler instead of the server-status handler, no matter how you arrange the directives.