> On 02/11/2011 17:53, Roberto De Ioris wrote:
>> You should rebuild uWSGI with debug enabled (set debug = true in
>> buildconf/default.ini and re-run make) and post the whole uWSGI log.
>> In this way we can see the whole set of variables passed by nginx.
>>
>> Take in account that adding --no-site will disable all of the installed
>> modules in python site-packages, so try removing it too.
>
> Hi Roberto,
>
> Thanks again for your reply. I've set debug = true in default.ini and
> recompiled. Also the --no-site switch has been removed from the start-up
> flags.
>
> My configuration now looks like this:
>
> --- nginx.conf begins ---
>
> server {
> listen 443;
> server_name hg.domain.com;
> location / {
> uwsgi_pass unix:/tmp/uwsgi.sock;
> uwsgi_param UWSGI_SCRIPT hgweb_wsgi;
> uwsgi_param UWSGI_CHDIR /usr/local/www/vhosts/hg.domain.com;
> include uwsgi_params;
> }
>
> location /static {
> alias
> /usr/local/lib/python2.7/site-packages/mercurial/templates/static;
> }
>
> [snip ssl config]
> }
>
> --- end of nginx.conf ---
>
>
> The uwsgi flags are set to: uwsgi_flags="-M -L --vhost"
>
> When I try to access the main Mercurial page, the log shows:
>
> [uWSGI DEBUG] uwsgi payload size: 731 (0x2DB) modifier1: 0 modifier2: 0
> [uWSGI DEBUG] PATH_INFO=/
> [uWSGI DEBUG] SERVER_NAME=hg.domain.com
> [uWSGI DEBUG] VirtualHost KEY=hg.domain.com|
> searching for hg.domain.com| in hg.domain.com|/hgweb_wsgi 0x801742ed0
> searching for hg.domain.com| in hg.domain.com| 0x8031109d0
> [uWSGI DEBUG] chdir to /usr/local/www/vhosts/hg.domain.com
> [uWSGI DEBUG] UWSGI_SCRIPT: hgweb_wsgi
> [uWSGI DEBUG] UWSGI_CHDIR: /usr/local/www/vhosts/hg.domain.com
> [uWSGI DEBUG] QUERY_STRING:
> [uWSGI DEBUG] REQUEST_METHOD: GET
> [uWSGI DEBUG] CONTENT_TYPE:
> [uWSGI DEBUG] CONTENT_LENGTH:
> [uWSGI DEBUG] REQUEST_URI: /
> [uWSGI DEBUG] PATH_INFO: /
> [uWSGI DEBUG] DOCUMENT_ROOT: /usr/local/etc/nginx/html
> [uWSGI DEBUG] SERVER_PROTOCOL: HTTP/1.1
> [uWSGI DEBUG] REMOTE_ADDR: xxx.xxx.22.145
> [uWSGI DEBUG] REMOTE_PORT: 53633
> [uWSGI DEBUG] SERVER_PORT: 443
> [uWSGI DEBUG] SERVER_NAME: hg.domain.com
> [uWSGI DEBUG] HTTP_HOST: hg.domain.com
> [uWSGI DEBUG] HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.1; WOW64;
> rv:6.0) Gecko/20100101 Firefox/6.0
> [uWSGI DEBUG] HTTP_ACCEPT:
> text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
> [uWSGI DEBUG] HTTP_ACCEPT_LANGUAGE: en-gb,en;q=0.5
> [uWSGI DEBUG] HTTP_ACCEPT_ENCODING: gzip, deflate
> [uWSGI DEBUG] HTTP_ACCEPT_CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.7
> [uWSGI DEBUG] HTTP_CONNECTION: keep-alive
> [uWSGI DEBUG] HTTP_CACHE_CONTROL: max-age=0
> [uWSGI DEBUG] called 0x8031109d0 0x803179a70 1
> Traceback (most recent call last):
> File "/usr/local/lib/python2.7/site-packages/mercurial/util.py", line
> 251, in increasingchunks
> for chunk in source:
> File "/usr/local/lib/python2.7/site-packages/mercurial/templater.py",
> line 214, in _flatten
> for j in _flatten(i):
> File "/usr/local/lib/python2.7/site-packages/mercurial/templater.py",
> line 207, in _flatten
> for i in thing:
> File "/usr/local/lib/python2.7/site-packages/mercurial/templater.py",
> line 161, in runmap
> for i in d:
> File
> "/usr/local/lib/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.py",
> line
> 288, in entries
> for row, parity in zip(rows, paritygen(self.stripecount)):
> File
> "/usr/local/lib/python2.7/site-packages/mercurial/hgweb/hgwebdir_mod.py",
> line
> 247, in rawentries
> if req.env['SCRIPT_NAME']:
> KeyError: 'SCRIPT_NAME'
>
> And a black page is shown in my web browser.
>
>
> If I then add these to the nginx.conf block:
>
>
I do not remember of mercurial needing SCRIPT_NAME, by the way, add
uwsgi_param SCRIPT_NAME "";
it should make it happy and it is fully WSGI 1.0 compliant.
Obviously remove uwsgi_modifier1 30 as you want the app to be mounted
under the root
--
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi