[GH-ISSUE #389] Disabling caching #330

Closed
opened 2026-02-26 06:32:20 +03:00 by kerem · 6 comments
Owner

Originally created by @Laizrod on GitHub (May 1, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/389

Hi. I don't even know if this is an actual issue, but I'm facing a caching problem with one of my websites (running Apache).
After investigations, I found out that nginx cache was causing my problem. I tried a lot of things I've googled, but nothing worked.
Could you please tell me how to disable nginx cache on a specific proxy host?

Thank you

Originally created by @Laizrod on GitHub (May 1, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/389 Hi. I don't even know if this is an actual issue, but I'm facing a caching problem with one of my websites (running Apache). After investigations, I found out that nginx cache was causing my problem. I tried a lot of things I've googled, but nothing worked. Could you please tell me how to disable nginx cache on a specific proxy host? Thank you
kerem closed this issue 2026-02-26 06:32:20 +03:00
Author
Owner

@mrneutron42 commented on GitHub (Aug 9, 2021):

I'm having the same problem. I think we found a bug.
It looks like Cache Assets control does not work in the GUI.
When you disable Cache Assets button, the caching does not stop, as you would expect.
Cache Assets button doesn't function

From reading these:
https://stackoverflow.com/questions/54136265/nginx-reverse-proxy-disable-cache
http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache

It was my understanding that he have to put the following into our proxy_host conf files:
proxy_no_cache 1;
proxy_cache_bypass 1;
then
proxy_cache off;

I think it goes in the "location / {" section of: ~nginxproxymanager/data/nginx/proxy_host/1.conf
After adding these lines, I restarted.

<!-- gh-comment-id:894898417 --> @mrneutron42 commented on GitHub (Aug 9, 2021): I'm having the same problem. I think we found a bug. It looks like Cache Assets control does not work in the GUI. When you disable Cache Assets button, the caching does not stop, as you would expect. ![Cache Assets button doesn't function](https://user-images.githubusercontent.com/70338169/128724033-4fb77a5e-fffb-471e-b9b0-c8424f069ae2.jpg) From reading these: https://stackoverflow.com/questions/54136265/nginx-reverse-proxy-disable-cache http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache It was my understanding that he have to put the following into our proxy_host conf files: proxy_no_cache 1; proxy_cache_bypass 1; then proxy_cache off; I think it goes in the "location / {" section of: ~nginxproxymanager/data/nginx/proxy_host/1.conf After adding these lines, I restarted.
Author
Owner

@chaptergy commented on GitHub (Aug 9, 2021):

I think you misunderstand the cache assets toggle. All it does is specifically cache css / js / image files by including this nginx config.

The cache should be disabled by default I think. But just to make sure you can just add the three lines you have mentioned to the advanced config tab:

proxy_no_cache 1;
proxy_cache_bypass 1;
proxy_cache off;
<!-- gh-comment-id:895485154 --> @chaptergy commented on GitHub (Aug 9, 2021): I think you misunderstand the cache assets toggle. All it does is specifically cache css / js / image files by including [this nginx config](https://github.com/jc21/nginx-proxy-manager/blob/develop/docker/rootfs/etc/nginx/conf.d/include/assets.conf). The cache should be disabled by default I think. But just to make sure you can just add the three lines you have mentioned to the advanced config tab: ```nginx proxy_no_cache 1; proxy_cache_bypass 1; proxy_cache off; ```
Author
Owner

@mrneutron42 commented on GitHub (Aug 9, 2021):

The cache should be disabled by default I think.

No, the default is clearly proxy_cache on, which is why we were trying to find a way to turn it off.
I've got a webcam image on a weather station webserver. The webcam image got cached by NGINX and the same image was repeated (not refreshed) with each refresh of the web page.
Adding the 3 conf file lines I mentioned, stopped the caching and the webcam image now updates, with each page refresh, as desired.

<!-- gh-comment-id:895490222 --> @mrneutron42 commented on GitHub (Aug 9, 2021): > The cache should be disabled by default I think. No, the default is clearly proxy_cache on, which is why we were trying to find a way to turn it off. I've got a webcam image on a weather station webserver. The webcam image got cached by NGINX and the same image was repeated (not refreshed) with each refresh of the web page. Adding the 3 conf file lines I mentioned, stopped the caching and the webcam image now updates, with each page refresh, as desired.
Author
Owner

@chaptergy commented on GitHub (Aug 9, 2021):

Weird, I'm not sure why it should be activated, since the only config contained in npm seems to be to switch it off. But glad it works.

<!-- gh-comment-id:895504062 --> @chaptergy commented on GitHub (Aug 9, 2021): Weird, I'm not sure why it should be activated, since the only config contained in npm seems to be [to switch it off](https://github.com/jc21/nginx-proxy-manager/search?q=proxy_cache). But glad it works.
Author
Owner

@mrneutron42 commented on GitHub (Aug 9, 2021):

Do you think it would be difficult to add switch to the GUI to turn off the cache?
That would be a nice feature to have!
Should I make a feature request?

<!-- gh-comment-id:895516794 --> @mrneutron42 commented on GitHub (Aug 9, 2021): Do you think it would be difficult to add switch to the GUI to turn off the cache? That would be a nice feature to have! Should I make a feature request?
Author
Owner

@chaptergy commented on GitHub (Aug 9, 2021):

Sure, go ahead

<!-- gh-comment-id:895518088 --> @chaptergy commented on GitHub (Aug 9, 2021): Sure, go ahead
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#330
No description provided.