On Tuesday 27. May 2014 09.27.29 Darren Spruell wrote: > Greetings, > > MoinMoin 1.9.7 > Gunicorn 18.0 > Nginx 1.4.1 > > I have a single wiki instance that works correctly when served from > the root of my site (/). I want to migrate it on the site now to be > served from /wiki/home/ (e.g. > http://www.example.org/wiki/home/HelpContents). When I configure this > on Nginx and then set 'url_prefix_static' in the MoinMoin config, wiki > pages are not served correctly. i.e. attempting to access > http://www.example.org/wiki/home/ attempts to load a page named > 'wiki/home' and MoinMoin returns 404 with "This page does not exist > yet. You can create a new empty page, or use one of the page > templates."
So you first need to make sure that Moin is served for that resource and not the root resource, and you then need to let Moin know that it is rooted at this new resource itself. > I cannot find a config option to instruct MoinMoin that it is being > served from a subdirectory of the site and to therefore operate under > a URL prefix. I understand that 'url_prefix_static' is only for static > media. I notice that > http://moinmo.in/HelpOnConfiguration#Configuration_of_multiple_wikis > documents a config option 'url_prefix' however various references make > it look as if that setting is no longer used/suggested. Yes, there's a mention of it in wikiconfig.py files that I've seen, but it appears to be obsolete. > Gunicorn is a WSGI server but as opposed to uwsgi it uses standard > HTTP as a service protocol; I think this prevents one from passing > environment settings (such as SCRIPT_NAME) as one would for e.g. FCGI > or UWSGI, etc. However I notice that placing the following in my > moin.wsgi seems to fix he path finding: > > os.environ['SCRIPT_NAME'] = '/wiki/home' Well, this should be presented to Moin by the Web server: that's what it is for! However, in moin.wsgi, you might be able to set the fix_script_name setting instead. > To me, this seems like more of a hack than a solution. > > Current config details: > > # Nginx config section > location /wiki/home { > try_files $uri @wiki_home_rewrite; > } > location @wiki_home_rewrite { > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > proxy_set_header Host $http_host; > proxy_redirect off; > proxy_pass http://127.0.0.1:8001; > } > > # wikiconfig.py > class Config(multiconfig.DefaultConfig): > ... > url_prefix_static = '/wiki/home' + url_prefix_static > ... > > Is there a way to configure MoinMoin to understand that it is being > served from a URL with a prefix path and operate as desired without > modifying the environment in the WSGI driver script? If you can get away with fix_script_name, then yes. Otherwise, perhaps not. Again, without things like SCRIPT_NAME, scripts know nothing about their environment or the way they are deployed. Paul ------------------------------------------------------------------------------ The best possible search technologies are now affordable for all companies. Download your FREE open source Enterprise Search Engine today! Our experts will assist you in its installation for $59/mo, no commitment. Test it for FREE on our Cloud platform anytime! http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk _______________________________________________ Moin-user mailing list Moin-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/moin-user