[BangPypers] Multiple Django app with nginx

Sathishkumar Duraisamy bewithsathish at gmail.com
Thu May 19 15:10:47 EDT 2016


On Thu, May 19, 2016 at 11:50 PM, Gora Mohanty <gora at mimirtech.com> wrote:

> On 19 May 2016 at 09:01, Sathishkumar Duraisamy <bewithsathish at gmail.com>
> wrote:
> [...]
> >
> >
> > May be you are right. I am really sorry, with many django developers here
> > in our local python list, I hoped to get solution.
>
> I do think it is off-topic: It really has to do with understanding
> how the proxy_pass directive in nginx works, and i is not just
> about being off-topic.


I am not interested to justify off-topic or on-topic.

I still think that you would get better
> answers on a nginx list. The fact that nginx is proxying to a
> Django application is irrelevant here.


It is all about django, gunicorn and nginx. The first two are python based
apps. And solution is here:

https://docs.webfaction.com/software/django/config.html#mounting-a-django-application-on-a-subpath



> Nevertheless, I am
> bored at the moment :-)
>
who cares? And this might be on-topic for you!

>
> [...]
> > Below is my nginx configuration, with domain name changed to example.com
> .
> > Here I two application one is Taiga which is basically django application
> > and second one is green, which is again, home grown django
> application.This
> > one is on second server( with different architecture with docker). I have
> > checked with browser with address 10.135.48.188:8000 and is working
> good.
>
> Your description points to a different issue: The problem is not
> that there are multiple upstream servers (those seem to be
> configured correctly, and should be working fine), but that you
> are seeing what you feel to be an unexpected redirection.
>

I justifying back-end is proper and working good without any broken links.
What saying django projects are running. That is describing the what
configuration is all about.

> I could see the home page of green project:
> >
> > https://example.com/green/
> >
> > When I try to login with links in the home page of green, it is pointing
> to
> > https://example.com/login instead of https://example.com/green/login.
> May
> > be it is correct from nginx reverse proxy.
> [...]
>
> I think that this the crux of the confusion: While I cannot
> test this now, the above redirection should be as expected
> from your configuration. Viz., with the configuration:
>
> location /green/ {
>     proxy_pass      http://green_servers;
> }
>
> https://example.com/green/login should indeed redirect
> to https://example.com/login
>
> Maybe these links will help (I am unable to do more
> without a test setup):
> * nginx core documentation: Please read carefully the
>   distinction between specifications with, and without
>   a URI. Your /api and /green locations are different
>   in this respect.
> * Multiple examples of such configurations:
>    http://www.liaohuqiu.net/posts/nginx-proxy-pass/
>
> A final thing to watch out for is trailing-slashes in the
> proxy-pass directive: The nginx behaviour here can
> be quite confusing.


It is not the problem. Request to go through explanation.

Regards,
> Gora
>
Things are solved. Thanks for you support.

> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> https://mail.python.org/mailman/listinfo/bangpypers
>



-- 
Regards,
Sathishkumar D


More information about the BangPypers mailing list