Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80 default_server;
- listen [::]:80 default_server;
- server_name 192.168.33.40;
- root /usr/share/nginx/html;
- # Load configuration files for the default server block.
- include /etc/nginx/default.d/*.conf;
- location / {
- # Проверка на наличие куки. Если куки есть, то сравнивает его значение
- if ($cookie_access != "eengae7aofiok2ohV5Ait1") {
- # Делает редирект на локейшн /addition-cookies, если значение куки несоответствует или отсутствует
- return 301 $scheme://$server_name/addition-cookies;
- }
- }
- location /addition-cookies {
- # Добавляет заголовок "Set-Cookie" и присваивает значение
- add_header "Set-Cookie" "access=eengae7aofiok2ohV5Ait1";
- # Делает редирект обратно
- return 301 $scheme://$server_name$request_uri;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement