#18987: Django contrib admin redirection error on actions
-------------------------------------+-------------------------------------
     Reporter:  audirs2 [at]         |                    Owner:  nobody
  gmail.com                          |                   Status:  closed
         Type:  Uncategorized        |                  Version:  1.4
    Component:  contrib.admin        |               Resolution:  invalid
     Severity:  Normal               |             Triage Stage:
     Keywords:  redirect             |  Unreviewed
  remote_auth_backend nginx          |      Needs documentation:  0
    Has patch:  0                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by aaugustin):

 * status:  new => closed
 * resolution:   => invalid


Old description:

> When user remote user authentication backend and accessing django
> application via Nginx proxy on subdomain behind this proxy the admin
> interface does not redirect from admin actions correctly.
>
> Settings below are applied:
> FORCE_SCRIPT_NAME=''
> APPEND_SLASH=False
>
> Server is running mod_wsgi
>
> accessing works ok.
>
> https://djangoapp.domain.com/admin/
>
> When using an admin action to add/delete etc redirects badly.
>
> E.g. on page url below you update some config and click add as the admin
> action, the underlying code carries out the action.
>
> https://djangoapp.domain.com/admin/appname/add/
>
> However when django redirects back to the apps list of objects it
> redirects badly to a url shown in the form below
>
> https://djangoapp.domain.com/admin/appname/add/.domain.com/admin/appname/add/
>
> It appears that the url resolution is using the domain with subdomain
> stripped and then as this is not the same full url it appends this url to
> the current one

New description:

 When user remote user authentication backend and accessing django
 application via Nginx proxy on subdomain behind this proxy the admin
 interface does not redirect from admin actions correctly.

 Settings below are applied:
 {{{
 FORCE_SCRIPT_NAME=''
 APPEND_SLASH=False
 }}}
 Server is running mod_wsgi

 accessing works ok.

 https://djangoapp.domain.com/admin/

 When using an admin action to add/delete etc redirects badly.

 E.g. on page url below you update some config and click add as the admin
 action, the underlying code carries out the action.

 https://djangoapp.domain.com/admin/appname/add/

 However when django redirects back to the apps list of objects it
 redirects badly to a url shown in the form below

 https://djangoapp.domain.com/admin/appname/add/.domain.com/admin/appname/add/

 It appears that the url resolution is using the domain with subdomain
 stripped and then as this is not the same full url it appends this url to
 the current one

--

Comment:

 (Fixed formatting -- please use preview.)

 If I understand correctly you have two layers: a frontend (nginx) that
 dispatches to a backend (apache+mod_wsgi). This is a very common setup and
 you don't need `FORCE_SCRIPT_NAME` to make it work properly.

 I don't understand your second comment: I don't see anything related to
 urlparse in build_absolute_uri.

 Generally speaking, the information you've provided is rather sparse, we
 have evidence that the admin works for thousands of developers using the
 same setup as you.

 This looks like a misconfiguration. I suggest using the
 [TicketClosingReasons/UseSupportChannels support channels].

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18987#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to