Okay, this just works! Amazing...
http { # nginx setup for proxy to apache/django + ssl
upstream backend_apache {
server 127.0.0.1:8080;
}
server {
...
# ****************************
# added as per Vitaly Babiy
# The proxy to Apache/Django
#*****************************
location / {
include /etc/nginx/proxy.conf;
proxy_set_header X-Forwarded-Protocol http;
proxy_pass http://backend_apache;
}
...
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;
proxy_pass http://backend_apache;
}
...
location / {
include /etc/nginx/proxy.conf;
proxy_set_header X-Forwarded-Protocol https;
proxy_pass http://backend_apache;
}
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
...
Listen 127.0.0.1:8080
...
### Section 2: 'Main' server configuration
...
ServerName my_domain.net:8080
...
### 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>
ServerName my_domain.net
# Tell Apache this is an HTTPS request without actually using
# mod_ssl.c and port 443 on localhost
# http://lincolnloop.com/django-best-practices/deployment/servers.html
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>
On Saturday, July 14, 2012 7:56:49 PM UTC-4, Graham Dumpleton wrote:
>
> Yes you can have more than one WSGIScriptAlias. The order is important
> though. Have that for the sub URL before that for root of '/'.
>
> WSGIScriptAlias /suburl /some/path/app1.wsgi
> WSGIScriptAlias / /some/path/app2.wsgi
>
> Can you post the actual configuration snippet you are using rather
> than refer to an old post as can only assume that you are actually
> entering it in correct?
>
> Graham
>
> On 12 July 2012 22:52, DougE <[email protected]> wrote:
> > Sorry to bother -- I have done this: setup and I have spent a week
> breaking
> > it by trying to add moin on this site as a sub url. I was trying two
> > <virtualhost>'s based on different ports, no luck.
> >
> > Can a single <virtualhost> tag contain more than one WSGIScriptAlias
> > directive?
> >
> > Can someone provide guidance on best way to call two completely
> different
> > wsgi scripts from Apache?
> >
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups
> > "modwsgi" group.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msg/modwsgi/-/FvtkKpOlu9gJ.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group at
> > http://groups.google.com/group/modwsgi?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/modwsgi/-/uRayJUOVHPEJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/modwsgi?hl=en.