Hi,
On Thu, Sep 21, 2017, at 08:22 AM, Dmitry Makovey wrote:
I'm tinkering with docker container of mailman 3.1 however I'm trying to utilize existing nginx server thus I need to map "/mailman" to mailman-web docker container vs default "/" mapping. Where do I configure base URI for mailman-web ?
There are two ways to do this,
This works right now with existing images on my test server but is an ugly hack (as-per uwsgi docs1). Your Nginx configuration would look something like this:
location /mailman3/ { # First attempt to serve request as file, then uwsgi_pass 172.19.199.3:8080; include uwsgi_params; uwsgi_read_timeout 300; uwsgi_param SCRIPT_NAME /mailman3; uwsgi_modifier1 30; }
SCRIPT_NAME *should* work by itself acc to uwsgi specs, but "uwsgi_modifier1 30" makes it work with some magic I haven't yet dug up on.
The correct way to do it would be to modify the uwsgi configuration to "mount" the wsgi application at a particular url prefix. uwsgi would then take care of re-writing the urls based on SCRIPT_NAME variable.
mount = /mailman3=wsgi.py ; rewrite SCRIPT_NAME and PATH_INFO accordingly manage-script-name = true
This the relevant configuration required in uwsgi.ini
2 for it to
work. The only problem right now is there is no way to change uwsgi.ini
script easily without tinkering with the image itself. There is an issue
open to fix this problem though3.
Lastly, a 3rd option would involve changing the urls.py4 to make Django do the work instead of uwsgi or nginx. It would require you to change the file and re-build the image yourself. I wouldn't suggest doing that though.
Hope that helps!
thanks, Abhilash
-- Abhilash Raj maxking@asynchronous.in