A
A
Alexander2017-10-10 12:13:02
PHP
Alexander, 2017-10-10 12:13:02

How to organize the substitution of the domain by the server based on the condition of the presence of a cookie?

Users access the site using the site.my domain.
It is necessary that when a user who has a cookie set, say DOMEN == r, all agents on the hosting consider that the r.site.my domain is being accessed.
Is it possible?
PS
In the platform used, page pre-generation and pages are returned from the html cache if it exists and Php is generated if not, and added to this cache itself. I need a different cache for cookie holders and those who don't.
I can't interfere with php.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Mukovoz, 2017-10-11
@castomi

It is necessary that when a user who has a cookie set, say DOMEN == r, all agents on the hosting consider that the r.site.my domain is being accessed

Theoretically possible. Before processing hosts, you need to conditionally find a request with a cookie and then change host. True, I'm afraid your task is not set correctly due to the fact that you have no idea how Nginx works. If you explain the essence of why you need all this, I will tell you how best to do it.)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question