We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on Vesta 2.0 and expect to release it by the end of 2024. Read more about it: https://vestacp.com/docs/vesta-2-development
Не кешировать некоторые html
Не кешировать некоторые html
Добрый вечер. Скриптом генерится html файлик, который обновляется 5-10 раз в день, люди которые заходят на него посмотреть видят старую версию, пока не обновят по Ф5 страничку, жалуются, что неудобно. Как бы nginx сказать что каталог где лежат эти файлики не кешировать, я так понимаю именно он это делает. Centos 7, vesta последняя
-
- Posts: 129
- Joined: Tue Mar 08, 2016 8:03 pm
- Os: CentOS 6x
- Web: nginx + php-fpm
Re: Не кешировать некоторые html
Собственно, тот же самый вопрос что и в http://forum.vestacp.com/viewtopic.php? ... 185#p41185
Do you using apache or apache+nginx or something else? :)
Do you using apache or apache+nginx or something else? :)
Re: Не кешировать некоторые html
Да, в обе ветки запостил.Nanotraktor wrote:Собственно, тот же самый вопрос что и в http://forum.vestacp.com/viewtopic.php? ... 185#p41185
Do you using apache or apache+nginx or something else? :)
Юзается дефолтно apache + nginx
-
- Posts: 129
- Joined: Tue Mar 08, 2016 8:03 pm
- Os: CentOS 6x
- Web: nginx + php-fpm
Re: Не кешировать некоторые html
В этом случае можно в конфиге nginx попробовать создать локейшен вида
По идее, должно сработать.
Code: Select all
location /path/to/file/test.html {
root /home/......../public_html;
add_header Cache-Control no-cache;
expires -1;
try_files /path/to/file/test.html;
}
Re: Не кешировать некоторые html
Nanotraktor wrote:В этом случае можно в конфиге nginx попробовать создать локейшен вида
По идее, должно сработать.
Code: Select all
nginx: [emerg] invalid number of arguments in "try_files" directive in
-
- Posts: 129
- Joined: Tue Mar 08, 2016 8:03 pm
- Os: CentOS 6x
- Web: nginx + php-fpm
Re: Не кешировать некоторые html
Должно быть что-то вродеst0rk wrote:Nanotraktor wrote:В этом случае можно в конфиге nginx попробовать создать локейшен вида
По идее, должно сработать.:( и не стартуетCode: Select all
nginx: [emerg] invalid number of arguments in "try_files" directive in
Code: Select all
try_files /path/to/file/test.html @fallback;
Либо просто заменить на что-то вроде:
try_files $uri $uri/index.html $uri.html =404;
http://nginx.org/ru/docs/http/ngx_http_ ... #try_files
Re: Не кешировать некоторые html
добавил fallback - стартует nginx без ошибок, fallback обьявлен.Nanotraktor wrote: Должно быть что-то вродеНу и fallback объявлен.Code: Select all
try_files /path/to/file/test.html @fallback;
location @fallback {
proxy_pass http://внешний_ip:8080;
}
но все равно при заходе на страничку вижу старый файл, который по ф5 преобразовывается в новый :(