Okay, this just works! Amazing...
http { # nginx setup for proxy to apache/django + ssl
upstream backend_apache {
}
server {
...
# ****************************
# added as per Vitaly Babiy
# The proxy to Apache/Django
#*****************************
location / {
include /etc/nginx/proxy.conf;
proxy_set_header X-Forwarded-Protocol http;
}
...
location /static {
alias /somedirectory/root_django_project/static/;
}
...
}
server {
...
listen 443;
...
location /static {
alias /somedirectory/root_django_project/static/;
}
...
[ssl directives]
...
location /moin {
include /etc/nginx/proxy.conf;
proxy_set_header X-Forwarded-Protocol http;
}
...
location / {
include /etc/nginx/proxy.conf;
proxy_set_header X-Forwarded-Protocol https;
}
location /other_encrypted_url {
...
#
#********************************************
# nginx basic http auth
#********************************************
auth_basic "Restricted";
auth_basic_user_file /some_directory/passwords;
#
...
}
}
# This is the main Apache server configuration file.
...
### Section 1: Global Environment
...
...
### Section 2: 'Main' server configuration
...
...
### Section 3: Virtual Hosts
...
NameVirtualHost *:8080
...
WSGISocketPrefix run/wsgi
...
#***********************************************
# IfModule configuration according to Vitaly Babiy
# This did work, but virtual host config
# seemed more parsimonious
#***********************************************
#<IfModule mod_ssl.c>
# Listen backend_apache 443
#</IfModule>
#***********************************************
<VirtualHost *:8080>
# Tell Apache this is an HTTPS request without actually using
# mod_ssl.c and port 443 on localhost
SetEnvIf X-Forwarded-Proto "^https$" HTTPS=on
#
WSGIScriptAlias /moin /default_directory/moin/server/moin.wsgi
WSGIDaemonProcess moin user=apache group=apache display-name=%{GROUP}
WSGIProcessGroup moin
#
WSGIScriptAlias / /some_directory/django_project_root/wsgi_handler.py
WSGIDaemonProcess yourhelpdesk user=apache group=apache display-name=%{GROUP}
WSGIProcessGroup yourhelpdesk
#
</VirtualHost>
> modwsgi+unsubscribe@googlegroups.com.