Juodvirshis
@Juodvirshis

Как сделать что бы index.php в корневой папке не кешировался?

Как сделать что бы index.php в корневой папке не кешировался?
location / {
    		try_files $uri $uri/ /index.php?$args;
 }

    location ~ \.php$ {
		try_files $uri =404;

		include snippets/fastcgi-params.conf;

		fastcgi_pass unix:/run/php/php7.3-fpm.sock;

		# Skip cache based on rules in snippets/fastcgi-cache.conf.
		fastcgi_cache_bypass $skip_cache;
		fastcgi_no_cache $skip_cache;

		# Define memory zone for caching. Should match key_zone in fastcgi_cache_path above.
		fastcgi_cache fraktal;

		# Define caching time.
		fastcgi_cache_valid 60m;
		#increase timeouts
		fastcgi_read_timeout 6000;
		fastcgi_connect_timeout 6000;
		fastcgi_send_timeout 6000;
		proxy_read_timeout 6000;
		proxy_connect_timeout 6000;
		proxy_send_timeout 6000;
		send_timeout 6000;

		#these lines should be the ones to allow Cloudflare Flexible SSL to be used so the server does not need to decrypt SSL
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-NginX-Proxy true;

    }
  • Вопрос задан
  • 80 просмотров
Пригласить эксперта
Ответы на вопрос 1
SignFinder
@SignFinder
Wintel\Unix Engineer\DevOps
создать location для index.php и добавить туда
add_header Cache-Control no-cache;
и можно еще
expires 1s;
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы