Nginx. Установка корневого пути сайта по cookies

Если стоит задача переопределять корневую директорию для сайта в зависимости от cookies, то сделать это можно следующим образом.
На входе имеем куку с именем «dev». В секции http конфига добавляем:
http {
….
map $cookie_dev $siteRootPath {
default «/home/site/www/»;
«anotherDir» «/home/site/anotherDir/»;
}

}
В данном примере подразумевается, что при куке dev равной «anotherDir» переменная $siteRootPath будет содержать «/home/site/anotherDir/». По умолчанию же устанавливаем $siteRootPath равным «/home/site/www/».

После этого в секции server прописываем:
server {

root  $siteRootPath;

}

Перезагружаем nginx

One thought on “Nginx. Установка корневого пути сайта по cookies

  1. Sexual relationship is really a pleasurable cooperation relationship with one?s partner. If anything goes wrong within this cooperation process, it’s enough to derail the partnership. But anything sometimes happens and that’s unpredictable. Moreover, able to keep a proper sexual relationship means keeping oneself physically healthy. So just about any sexual disfunction must be addressed with utmost care. One such hazard to health is male impotence commonly seen in men. Unable to keep a proper and prolonged penile erection brings about male impotence. This is infact a critical problem for maintaining a normal sexual relationship. So when there arises this kind of problem it?s a good idea to treat it instead of sitting quiet.

    The choice between the various available treatment methods involve treatment with a proper medicine. Response to a dental agent like Levitra can be quite effective in this context. Studies show that erection dysfunction is especially on account of insufficient blood circulation towards the penis? veins and deficiency of stimulation also. Practising oral therapy of Levitra boosts the rate of the flow of blood that gradually stimulates the penis causing a hard erection, adequate to have an intercourse.

    Levitra is a such drug which can be seen to be effective. Clinically it is often proved that it even works on patients who are suffering from various health issues like high blood pressure, high cholesterol levels or diabetes. A lot of men, who took Levitra the first time, responded positively for gaining high success rate. Besides, it has been also found which it can be also taken with other medicines utilized to treat other health concerns.

    https://www.cialispascherfr24.com/tadalafil-comprime/

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *

*