R
R
Ruslan Ezhgurov2015-12-01 10:54:52
Django
Ruslan Ezhgurov, 2015-12-01 10:54:52

How to forward to nginx the address that the user wants to get to?

There is a site with subdomains, all requests for subdomains go to one place. Due to the specifics of the project, I can’t process the request address in the url, you need to find out what address the user is interested in in views.py and do something with it already there.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
marazmiki, 2015-12-01
@Oyaseo

You need to configure nginx correctly, then the host will be determined as expected. Pass Host and X-Forwrded-For headers from nginx to the backend. And everything will be fine.
And what, if not a secret, is there such a specificity that makes it impossible to use urls?

A
Andrey, 2015-12-01
@andreypaa

I think the information of interest is stored in request.resolver_match

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question