# uWSGI + Moin (subdir) + Nginx

**URL:** <https://www.ruby-forum.com/t/uwsgi-moin-subdir-nginx/227697>\
**Category:** NGINX\
**Created:** [March 25, 2013, 6:52pm UTC](https://www.ruby-forum.com/t/uwsgi-moin-subdir-nginx/227697 "2013-03-25T18:52:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![calabriama](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ac8455/32.png) [@calabriama](https://www.ruby-forum.com/u/calabriama)\
**Post date:** [March 25, 2013, 6:52pm UTC](https://www.ruby-forum.com/t/uwsgi-moin-subdir-nginx/227697/1 "2013-03-25T18:52:27Z")

</div>

Hi,

I followed the example in:

[http://projects.unbit.it/uwsgi/wiki/Example#MoinMoinonlinenow](http://projects.unbit.it/uwsgi/wiki/Example#MoinMoinonlinenow)

However when I type domain/wiki I get a message that the page does not  
exist yet… which already tells me something is wrong, and also all my  
URL’s are point to ‘/’ not ‘/wiki’

I can’t seem to figure out why this happens… I tough using:

uwsgi\_param SCRIPT\_NAME /wiki;  
uwsgi\_modifier1 30;

Would do the trick… but It doesn’t…

Please note that I’m using moin-1.9.4, py27-uwsgi-1.2.4

As for nginx:

nginx version: nginx/1.3.14  
built by gcc 4.5.3 (NetBSD nb2 20110806)  
TLS SNI support enabled  
configure arguments: --user=nginx --group=nginx  
–with-openssl=/home/miguelc/sources/openssl-1.0.1e  
–with-ld-opt=‘-L/usr/pkg/lib -Wl,-R/usr/pkg/lib’ --prefix=/usr/pkg  
–sbin-path=/usr/pkg/sbin --conf-path=/usr/pkg/etc/nginx/nginx.conf  
–pid-path=/var/run/nginx.pid --lock-path=/var/db/nginx/nginx.lock  
–error-log-path=/var/log/nginx/error.log  
–http-log-path=/var/log/nginx/access.log  
–http-client-body-temp-path=/var/db/nginx/client\_body\_temp  
–http-proxy-temp-path=/var/db/nginx/proxy\_temp  
–http-fastcgi-temp-path=/var/db/nginx/fstcgi\_temp --with-ipv6  
–with-mail\_ssl\_module --with-http\_ssl\_module --with-http\_spdy\_module

Thanks

---

<div class="post-metadata">

**Author:** ![calabriama](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ac8455/32.png) [@calabriama](https://www.ruby-forum.com/u/calabriama)\
**Post date:** [March 25, 2013, 7:01pm UTC](https://www.ruby-forum.com/t/uwsgi-moin-subdir-nginx/227697/2 "2013-03-25T19:01:13Z")

</div>

> I can’t seem to figure out why this happens… I tough using:
> 
> uwsgi\_param SCRIPT\_NAME /wiki;  
> uwsgi\_modifier1 30;
> 
> Would do the trick… but It doesn’t…

Do not use that trick, is pretty outdated and incredibly ugly.

Just let uWSGI do the SCRIPT\_NAME rewrite, add the --manage-script-name  
to  
the option (be sure to use the --mount way for loading moinmoin). The  
nginx configuration will be simply

location /wiki {  
include uwsgi\_params;  
uwsgi\_pass …;  
}

–  
Roberto De Ioris

> **[unbit - Overview](https://github.com/unbit)**
>
> makers of uWSGI and many more open source projects - unbit

---

<div class="post-metadata">

**Author:** ![calabriama](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ac8455/32.png) [@calabriama](https://www.ruby-forum.com/u/calabriama)\
**Post date:** [March 25, 2013, 7:12pm UTC](https://www.ruby-forum.com/t/uwsgi-moin-subdir-nginx/227697/3 "2013-03-25T19:12:55Z")

</div>

Thanks for the hint… I though passing SCRIPT\_NAME was a “ugly” way to  
do  
into, but since it was refereed in the docs…

I was using mount:  
uwsgi -s /tmp/moin.socket --uid nginx --gid nginx --mount  
/wiki=/usr/pkg/share/moin/mywiki/moin.wsgi -M -p 2 -d  
/var/log/nginx/uwsgi\_moin.log --logdate  
–pidfile=/var/run/uwsgi\_moin.pid

I added --manage-script-name has suggested, now it points to the right  
direction… 😉

It would be nice if the link was updated with this info…

Many thanks,  
Mike
