All Questions
453
questions
-1
votes
1
answer
80
views
open() "/var/lib/nginx/cache/fastcgi/3/d0/bce7bdb8e2c388c7675c97c7324efd03" failed (13: Permission denied)
I am trying to add Caching for Proxy & FastCGI but once i try to view any page on the site it fails with 500 Internal Server Error and when i tried searching my logs for any errors i found that ...
0
votes
0
answers
70
views
nginx: does it generate conflicts if any of the dynamic modules are different?
I have an instance on AWS running Ubuntu 22.04 on which I installed nginx and cloned the instance to build the ngx_purgue_cache module.
This is my current nginx output
$ nginx -V
nginx version: nginx/...
0
votes
2
answers
137
views
Nginx try_files succeeds on deleted files, then nginx reports error with open()
I have this weird error that is happening where try_files directive successfully finds a file that was just deleted, then nginx proceeds to open the file and returns an error.
I am using a standard ...
0
votes
1
answer
91
views
Nginx. Override header in cached object, is it possible?
My team uses nginx with cache. The problem is that the application in upstream sends some headers that we would like to override in the cached object. One can see the headers saved in the cached ...
0
votes
1
answer
150
views
Nginx FastCGI Skip Cache Rules for /shop/ in Wordpress woocommerce, why aren't they working?
I am running a LEMP server with Wordpress and Woocommerce. My site is live at https://www.mcmo.is.
My Nginx Skip Cache rules seem to be working except for on one page: https://www.mcmo.is/shop
When ...
0
votes
0
answers
62
views
Nginx + Wordpress caching - Configuration file sequencing
I'm new to Nginx and Wordpress as a combo. I would love a sanity check on this server side caching code.
Specifically
Is the sequencing correct - esp. the location statements?
Is there anything ...
0
votes
0
answers
30
views
nginx assets cache not working
I try to add cache for all css/js files in nginx configuration file and i get error.
location ~* \.(css|js)$ {
add_header Cache-Control public;
add_header Pragma public;
add_header Vary ...
0
votes
1
answer
301
views
Nginx FastCGI cache is EXPIRED when it should not
Nginx sets the x-fastcgi-cache header to EXPIRED a few hours after the page was first cached, whereas the cache validity is 1 week.
Nginx Config:
fastcgi_cache_path /usr/share/nginx/fastcgi_cache ...
0
votes
1
answer
790
views
Nginx cache does not set the "X-Proxy-Cache" header
So I´m currently trying to implement caching on my NGINX webserver.
For now I have a single conf file in my sites-enabled directory linked, which looks like this:
proxy_cache_path /var/cache/nginx ...
0
votes
0
answers
362
views
How to create a proper nginx fastcgi configuration for 1 server 1 domain
I would like something simple
like everything to redirect to ssl and from there cached I guess no?
How can I get non www version to redirect to www version as well
PS. I am using ssl strict ...
1
vote
1
answer
236
views
How can I curl -IL all the website pages starting with the root pagenot just 1 page at the time?
I need to curl -IL all the website and maybe do cron job or something every 24hrs so fastcgi can cache all the pages on vgo
The cache don't hit unless I curl -IL the webpage so I need something that ...
1
vote
1
answer
1k
views
Nginx - No last-modified or Etag response header on HTML
I am facing a rather odd issue with my web server. The server is configured with Ubuntu 20.04, Nginx v1.22.1, PHP 8.0, and MariaDB to host my WordPress website.
The issue is, the server is not sending ...
0
votes
0
answers
205
views
Browser random behaviour in using cache and reloading for js/css from server despite setting cache-control header
I have set cache-control header in my nginx conf file successfully for js/css files
location ~* \.(css|js)$ {
add_header Pragma public;
add_header Cache-Control "public, must-...
0
votes
1
answer
709
views
Issue with 'mkdir(): No space left on device" in Docker Container. Might be some other issue though?
I have some docker containers (NGINX / PHP, MySQL, etc.) that have been running fine for years. However, recently I started seeing this error when running a PHP script in Laravel in the NGINX / PHP ...
0
votes
1
answer
977
views
Nginx cache for frequent and different requests
I have a service.
This service has a GET handle(/api/v1/retrieve_blocks).
This handle's requests and responces are small, no more than 1024 characters.
regular situation:
this handle is constantly ...
0
votes
1
answer
437
views
Nginx - fastcgi cache not working for rewrite enabled php page
I've been trying to figure out why Im failing to achieve fastcgi caching for a rewrite rule applied php page.
While all other request wonderfully cache, the rewrite ^(.+)/special/?$ /inc/special....
0
votes
1
answer
246
views
Share cache between multiple location blocks
Considering a nginx server with the following two locations which each serve a webapp, including some static resources and a REST API. Is there a way to cache the common resources, e.g. /proxy/host1/...
1
vote
0
answers
70
views
custom fast cgi cache duration for a location
i have this configure
location ~* \.php$ {
try_files $uri /index.php =404;
fastcgi_pass phpstream;
fastcgi_index index.php;
fastcgi_cache GCache;
...
2
votes
1
answer
495
views
Nginx - disable rate limiting for cached resources
I have an application does full text search on my product database. Certain searches are suggested to the user and are much more common than other searches.
As full text searches are expensive, I'm ...
0
votes
0
answers
167
views
How to properly cache content in NGINX like in Plus version?
I saw official NGINX tutorial regarding content caching and tried to modify it according to my needs. I use CDN (Cloudfront), but the performance doesn't convince me. If my server was more faster it'd ...
1
vote
1
answer
863
views
getting 412 precondition failed with ngx_cache_purge when trying to purge cache
I am new to this and just started using nginx for my pet projects. now i would like to install and use ngx_cache_purge module from https://github.com/nginx-modules/ngx_cache_purge, since it has some ...
0
votes
1
answer
274
views
NGINX Reverse Proxy And Cache MS Graph API
I'm building a web based company directory which has roughly 450 employees. The data source being used is the Microsoft Graph API (Azure AD). This API requires you to make a request for every employee ...
0
votes
2
answers
795
views
Adding location-block to cache files makes those files return 404
I want to cache some static files using Nginx. But I somehow can't get it to work.
This is my nginx.conf:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*....
1
vote
1
answer
372
views
NGINX: Can I to use proxy_no_cache directive with upstream response body for conditional caching?
We are using Ngnix as a cache-proxy in front of a 3rd party service and have the following directive to ensure upstream responses with a status code of 200 are cached...
proxy_cache_valid 200 364d
The ...
0
votes
1
answer
118
views
"The User Agent is required to access this page" message only goes away when I clear NGINX cache
I'm new to NGINX and can't really tell if there's a problem with it or with our app. My PHP application has a php package Device Detector that is responsible for User Agent info as well as CodeIgniter,...
2
votes
1
answer
1k
views
How to automatically purge cache with nginx using the http-cache-purge module (ngx_http_cache_purge_module.so)
I am running an Ubuntu 20.04 LEMP server with wordpress installed on it.
I am using the nginx.org repository for nginx, but I compiled the cache-purge module (ngx_http_cache_purge_module.so) from ...
0
votes
0
answers
261
views
Caching 401 response on bad token in nginx njs
In our application whenever a token (that arrives in a header) is invalid - it is practically guaranteed there won't be an exact valid token.
So I'm trying to offload the responsibility of responsding ...
0
votes
0
answers
428
views
HTTP_IF_NONE_MATCH Missing on Server Side with Chrome Requests to NGINX
I'm trying to add etag based cache verification to a web app I've developed that runs on Apache via an NGINX reverse proxy. The web app is written in Perl. In the Perl script, I check for the $ENV{'...
0
votes
1
answer
381
views
Setting Nginx expires epoch header selectively
I have a folder containing imagery on my server that is used to service both a mobile app, via a CDN, and to work with a backend webapp used to manage the content delivered to the app. For the latter ...
0
votes
0
answers
267
views
Disable nginx cache for a specific URL in site [duplicate]
We want to disable cache on a specific URL in our site.
The problem we have is that when a user buys something, this purchase only is reflected in user's profile when nginx cache is cleared
User's ...
1
vote
1
answer
224
views
How to tell nginx to honor backend's cache? uWSGI
There's a similar question but solution there doesn't work for me.
We have nginx and uWSGI ad backend. We need nginx to cache the backend response according to what is in the response header.
For ...
0
votes
1
answer
612
views
PHP-FPM - nginx - clear cache in different environments
We have an environment with a web server running nginx, this has 4 virtual hosts (2 of them are the ones running in production, and the others 2 are for testing).
We run php-fpm and all that nginx ...
0
votes
1
answer
648
views
How to cache PHP on nginx?
Say that I am creating a news site on example.com, and now I have example.com/latest.php, this is a script that does a lot of query, and I want to improve performance. How can I configure php/nginx, ...
1
vote
1
answer
2k
views
Nginx static files caching from different folders
The problem is nginx does not display images and shows 404 not found on some folders.
When i remove caching from config everything works fine.
Trying to configure nginx to cache static files with this ...
0
votes
0
answers
527
views
Cache Images centrally
Application: Serve responsive and optimized images on the fly by cropping/resizing/compressing master images
Current Load: 10k request per minute, ~60MBps traffic.
Current Config : NginxPlus LB sits ...
0
votes
1
answer
3k
views
How to Avoid Crazy Caching with "Vary: Cookie" Header in NGINX
I know Vary: Cookie is not well liked, since it causes caching of every variation of cookies a user might report. On the other hand, without it, I've had to use Cache-Control: no-cache to tell my ...
3
votes
1
answer
1k
views
Stop NGINX from locally caching a directory
So, the issue I am currently facing is that NGINX on my system keeps caching huge video files in memory when a HTTP request is made. This is causing NGINX to be using 20GB+ of memory and me having to ...
1
vote
1
answer
2k
views
How can I know the name of the cache file created by NGINX?
Suppose I make a request, https://example.com/path1/2?v=1, and have enabled the proxy caching. How do I know the name of the cache file created by NGINX? The problem is, I want to delete the cache for ...
0
votes
1
answer
561
views
NGINX: Ignoring fbclid parameter for FastCGI Cache Purposes
There are some good responses to this question here: NGINX: Ignoring Certain URL Parameters for Cache Purposes
But I cannot seem to get it to work. I'm running a wordpress install and here is my ...
0
votes
0
answers
559
views
Using nginx $request_id for CSP nonce value: how to avoid caching it?
I'm using the nginx $request_id for the CSP nonce value, but how can I get fastcgi_cache to bypass caching it?
I tried this above the location block where the variable is created, but it seems to stop ...
1
vote
1
answer
520
views
[Firefox and nginx]: Firefox seems to cache and deliver the content of the wrong subdomain
I'm currently running a mix of different services under different subdomains:
a.example.com: Docker container behind nginx proxy
b.example.com: nginx site
c.example.com: Docker container behind nginx ...
0
votes
1
answer
138
views
How to add single nginx cache keys or file
How to add single nginx cache keys or file before client access link website. if link website quite more content example: html, image, video... several first access site very slow for cache server ...
1
vote
1
answer
1k
views
nginx: disable open_file_cache for specific file
we are using nginx with file cache on:
http {
open_file_cache max=10000 inactive=20s;
open_file_cache_valid 60s;
open_file_cache_min_uses 4;
open_file_cache_errors ...
2
votes
0
answers
255
views
Why does Nginx's new files' permissions supersede my default ACL
I have issues setting up proper permission on cache directory on a site that run on Debian 10 with Nginx and php-fpm.
I have an user 'myuser' which home is /var/www/mydomain.tld
The strucure of the ...
0
votes
2
answers
488
views
Tool to create pre-compressed [Brotli] files
I am trying to pre-generate compressed brotli files in designated directories for static html, css and js files.
I found a rust tool here – https://github.com/neosmart/static-compress
Besides this, ...
0
votes
1
answer
225
views
Sending cache headers only for a single request [or for a request following a certain path string]
I have the proxy pass in nginx config defined as follows:
location / {
proxy_pass http://localhost:3001;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $...
0
votes
2
answers
1k
views
Cache response with nginx and browser, but not CloudFlare
My backend application sends Cache-Control headers so that NGINX and the browser can cache responses.
I would like CloudFlare to not cache these responses. This is because they may have non-public ...
0
votes
1
answer
1k
views
Alternative to using if statement in nginx location block
Nginx config goal:
Check if a certain cookie exists (doesn't matter what the value is)
If it doesn't exist, include a particular config import.
I only want to apply my rules to certain Locations, I ...
0
votes
1
answer
2k
views
Using an Nginx proxy cache to prevent duplicate requests?
I am using an Nginx proxy as a front-end to a web application that tends to get identical duplicate requests milliseconds apart, causing duplicate items in my database.
I thought I might be able to ...
1
vote
1
answer
9k
views
My browser keeps showing cached page despite sending no-cache, no-store, must-revalidate from server in response header
The content on our pages keep changing and hence we do not want the browser to cache the page or show cached page or our users. But the browser keeps showing cached page despite sending no-cache, no-...