J
J
JunDevTest2018-08-06 18:15:24
Nginx
JunDevTest, 2018-08-06 18:15:24

Debug config for Nginx, need help implementing an idea?

Greetings.
This time, I need help regarding the Nginx config in which to set the Debug option.
Details:
While working with the site, sometimes I need to quickly switch to debug mode to solve a particular situation. I had an idea to do this with a cookie called debug_mode. When the cookie is activated, my script goes into debug mode, showing me what I need to know to debug.
From the Nginx side, I need the following:

if (isset($COOKIE['debug_mode'])) {
## Выключить Gzip для всех типов контента
gzip tmp_off;
## Выключить кеширование CSS, JS, HTML
cache tmp_off
## Принудительно сбросить кеш в браузере ( послать заголовки )
header "Cache: A nu bistro reset";
## Подробный error.debug.log
error_log /var/log/nginx/$DOMAIN.error.debug.log;
}

Please make up how to write it correctly, the pseudo-config above, of course, will not work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SagePtr, 2018-08-06
@JunDevTest

It’s easier to raise a second instance of nginx on another port (or add another port with its own separate inputs to this listener) and add this port in the browser to the site address to activate debug mode.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question