Graham:
On 10 Jun 2019, at 5:43 am, Gertjan Klein <gkl...@xs4all.nl <mailto:gkl...@xs4all.nl>> wrote:
[...]
* In my previous setup, I used Alias statements in the (main) Apache configuration for my static files. It appears these don't work in combination with the ProxyPass statement.

Depends on how you set up Proxy statements and the order you have directives in the Apache configuration file. Impossible to comment without seeing what you are using. Can you show what you are using?

I don't have that configuration anymore. However, I've studied the help generated with --help, experimented a bit, and find I don't actually need the aliases anymore. I now run (in the base directory for the application, with the virtual environment activated):

mod_wsgi-express setup-server daglengte/wsgi.py --port=8000 \
  --user gklein --group www-data \
  --server-root=../apache --http2 --host localhost --setup-only \
  --document-root ../../www \
  --url-alias /static static \
  --include-file ../apache_wsgi.conf \
  --trust-proxy-header X-Forwarded-Host \
  --trust-proxy-header X-Forwarded-Port \
  --trust-proxy-header X-Forwarded-For \
  --trust-proxy-header X-Forwarded-Scheme

This appears to do exactly what I want. Static files from the Django application are handled by the --url-alias. Files like robots.txt, lets-encrypt challenges etc. are handled by --document-root. All automatically setup with the proper Apache configuration. I still have the --include-file in there, but it's actually empty. :) (I am quite impressed with how easy all this actually is with mod_wsgi-express!)

The virtual host configuration of the main Apache now handles, in essence, (common) logging and SSL. The proxying does the rest.

I have one last task left for this application: integrate into the system startup sequence. I have done something similar before, I'll be able to figure that out. Then it's on to the other sites!

Thanks again, regards,
Gertjan.


--
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/modwsgi/qdm8tc%2461uh%241%40blaine.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to