-1
votes
1answer
29 views

Debug Nginx caching

I want to determine when I am getting cache hits or misses. Preferably, this would be a header, like X-Cache: HIT or X-Cache: MISS How can I do this with Nginx (a reverse proxy for the upstream ...
-1
votes
1answer
18 views

Does Nginx respect maxage from upstream server?

I see the proxy_cache_valid directive, but that confuses me. In HTTP, doesn't the upstream server specify this with Cache-Control and maxage? How do I get Nginx's cache to use maxage ?
1
vote
1answer
30 views

Nginx not caching data

I have a REST API behind an nginx proxy. Proxying works fine, however I am unable to cache any responses. Any help would be much appreciated: Nginx config: worker_processes 10; error_log ...
0
votes
1answer
53 views

Varnish cache with NGINX files not updating WordPress

It seems that Varnish is missing or not validating cache properly. When I try and purge my cache, I get 200 OK Cache successfully cleared, but my page does not update. I am simply making HTML changes ...
0
votes
1answer
137 views

why adding Expire-Header to static files in nginX does not work

I have a single server block where my site resides in. Inside of that block I've added a location block as below: server { ... location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { expires 30d; ...
0
votes
1answer
30 views

nginx: how to cache negative FastCGI responses only

Need some collective brainstorming :). There is a heavy PHP application (e.g. Magento) and each time a visitor hits a non-existent page (or there is a problem with a particular part of the ...
-2
votes
1answer
66 views

Nginx CSS Caching [duplicate]

I've been trying to fix this for a while, but I haven't been able to find a solution. Some notes about my setup: I am not using VirtualBox I am running Nginx 1.4.6 Ubuntu The CSS's cache will not ...
0
votes
0answers
35 views

How to make sure that Nginx does not cache 4xx and 5xx errors?

We are using a caching Nginx Proxy as a local npm mirror. Sometimes it can get in an inconsistent state where accessing certain URLs always returns 400. I assume that Nginx is configured to cache ...
1
vote
2answers
57 views

After ntpdate update for ubuntu server I always receive the old php file in nginx

The problem with nginX caching happened when I used ntpdate ntp.ubuntu.com to sync my server clock. Now when I request the path http://www.example.com/project/create I receive the old PHP file that ...
0
votes
1answer
187 views

Nginx not caching any proxied requests

I believe I've properly set up nginx to cache all requests proxied to PHP-FPM, but it's not working. Here's the "http" bit from /etc/nginx/nginx.conf: http { include ...
-1
votes
2answers
58 views

Nginx and its caching systems. Are they all the same?

I'm a bit confuse about PageSpeed, Microcaching and Memcached. Are they just different tools that do the same job? I was initially thinking in use PageSpeed with Nginx. If I do that, do I need ...
0
votes
2answers
81 views

How to prevent nginx caching blank pages?

I have nginx 1.4.3 running on a Ubuntu 12.04 machine. I have nginx set up to cache pages (they are database-driven but stay fairly static). I'm using MySQL and PHP-FPM. However, I found that I would ...
0
votes
0answers
23 views

How can I configure what to cache in nginx?

I have a REST API for which I'm using nginx as a reverse proxy. I want to cache certain calls to the API which use absolute time references in the request but I want to not cache calls which use ...
0
votes
0answers
109 views

Empty $upstream_http_location variable if response was cached

I would like to cache the response of an redirect. (Cache the request to some site which returns a redirect and cache the second request which returns the actual content.) So far my config looks like ...
0
votes
0answers
13 views

Static App, How Many concurrent connections can my basic vsp handle? [duplicate]

So I have this simple web app. What it does is simply outputting a xml file 1-3kb in size, gzipped. My current vps is a basic one, with 2 gb of ram and 2x2ghz processor power. I use centOS and nginx. ...
2
votes
2answers
1k views

How to invalidate nginx reverse proxy cache in front of other nginx servers?

I'm running a Proxmox server on a single IP address, that will dispatch HTTP requests to containers depending on the requested host. I am using nginx on the Proxmox side to listen to HTTP requests ...
0
votes
1answer
306 views

Clear nginx cache via HTTP request?

I have the usual proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=drupal:16m; proxy_cache_key "$scheme$host$request_uri"; to establish proxy caching. How should I ...
2
votes
1answer
110 views

Nginx or Varnish caching with multiple versions of a site

I have a website (https://mediacru.sh) that has a few versions. There's the normal desktop site, the same site with a dark theme, and the mobile site. They all share the same URLs. The theme is ...
0
votes
0answers
28 views

NGINX cache mis-behaving causing the system to go into a frenzy

We're using CentOS/nginx fastcgi_cache to cache requests to PHP files on our server. This file gets accessed very often and also updates very often as such it has 1s cache. Usually when looking ...
0
votes
0answers
36 views

Altering Cache value based on php response of an image or html in Nginx

I'have a set up where a PHP script dynamically creates images based on size and the device requesting them. Everything is working fine apart setting a higher cache expiry for images when they are ...
0
votes
1answer
87 views

NGINX - dynamic proxy_cache_path directory

Has anyone ever successfully configured separate cache folders for different sites?
0
votes
0answers
97 views

Force end user browser to forget old SSL - Caching & Secure Pages

Problem I recently switched the domain of my website. websiteA.com to websiteB.com (Stack: LEMP, running memcache and Varnish for caching.) I set up nginx to 403 re-direct everything and on new ...
1
vote
0answers
175 views

Nginx cache shared between multiple servers

We have 8 REST-ish API servers with Nginx using FastCGI with PHP-FPM to handle requests. We're currently using Nginx' FastCGI caching (directives like fastcgi_cache_path). This means that API ...
1
vote
1answer
304 views

How to make an existing caching Nginx proxy use another proxy to bypass a firewall?

My question is about using Nginx as a proxy behind another proxy. (Somewhat confusing.) I want to set up Nginx so it acts as a caching proxy server to an npm mirror. Here is the link: ...
0
votes
1answer
107 views

DNS/Server change causing blank page

We have recently changed servers and hosts of our test|production environment. Right now we are still testing but our http://test.example.com, is sometimes showing just a blank page to certain users. ...
0
votes
0answers
232 views

nginx wont cache images when they are read through php files

i have .php file wich is loading images to hide their location. Every images are correctly caching through this directive: location ^~ \.(jpg|jpeg|png|gif|ico|css|js)$ { expires max; ...
1
vote
2answers
38 views

When I try to cache with nginx I get 404 on resources

I googled around and found some scripts on how to cache static resources on nginx, the problem is that when I apply these scripts I get 404 on my scripts and styles. What am I doing wrong here? I'm ...
0
votes
0answers
38 views

Setup nginx to return last cached item, then update cache via proxy_cache and proxy_cache_use_stale

I am trying to setup nginx in front of a service with a significant load/warm-up time. I would like to setup the proxy_cache so that the last cached value will be returned immediately and nginx will ...
0
votes
0answers
163 views

nginx - serving stale cache response while updating

In nginx I am using the proxy_cache_use_stale updating directive (http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_use_stale) so that concurrent request to an invalidated cached ...
0
votes
0answers
282 views

Nginx + php-fpm + Zend Opcache + php 5.3.10 - Dynamic Generated CSS|JS

I have the Zend Opcache pecl extension working almost completely- except for that I have 4 files that technically are content-types of css and js - but are "php" files and get sent through fastcgi and ...
3
votes
2answers
4k views

Nginx + php-fpm - Each php-fpm process 70-100% cpu when running

I have a situation in which the following is taking place: We are on linode with 8-core, 8gb of ram , 2.6 ghz - using nginx + php-fpm - we are getting extremely high graphs of cpu usage (which we ...
0
votes
0answers
48 views

Nginx + W3 Total Cache not working

I have a Ubuntu 12.10 x64 server running Nginx + MySQL, i've installed everything and my wordpress site is perfect. But, at the moment i installed W3 Total Cache, i got an error from Minify which ...
0
votes
2answers
303 views

How do I set nginx's cache files to file permissions 777?

I'm trying to write a process that invalidates the cache on nginx (and doesn't re-warm the cache). By default, nginx has 700 on its cache files. The closest setting that I could find was: ...
0
votes
2answers
363 views

nginx: fastcgi_cache_path empty

I wanted to try fastcgi_cache on my nginx 1.5.8 setup as shown here. In nginx conf, http section, I added: fastcgi_cache_path /var/cache/nginx levels=1:2 keys_zone=microcache:10m max_size=1000m ...
0
votes
1answer
327 views

nginx cache gzip file's to temp directory?

Is the following possible through Nginx: I now have gzip on; but the server needs to compress the popular files everytime, the files are xml files created through a database, but they are "static". ...
2
votes
0answers
209 views

Nginx not honoring must-revalidate

I want to use nginx as a caching reverse proxy. I also have a special requirement, which I thought could be accomplished with nginx. I am using Amazon s3 as origin server and I use signed urls to ...
0
votes
0answers
387 views

Nginx does not cache json

I have the following nginx configuration user nginx; worker_processes 10; pid /var/run/nginx.pid; events { worker_connections 1000; } http { sendfile on; tcp_nopush on; tcp_nodelay ...
0
votes
0answers
51 views

Clear NGINX cache using FTP

I have an NGINX server set-up to handle caching for a website (running elsewhere). Works like a charm, however we want to administrators to have an option to flush the cache from their backoffice. I ...
1
vote
1answer
171 views

Serving a file with an expires header depending on when it was last modified

In nginx is there a way to conditionally serve a file with different expires headers depending on when the file was last modified? For example, if foo was modified within the last week then I want it ...
1
vote
1answer
975 views

Configure nginx for max-age=0 requests

I'm using nginx as a reverse proxy with proxy_cache. The back-end is setting cache-control response headers which makes nginx serve responses from cache when possible. However I would like to allow ...
0
votes
1answer
32 views

Nginx cache to serve cached content instead of error pages

Is there any way to configure Nginx to serve cached content instead of error pages? Let's suppose that accessing a page /abc.html resulted in 200 and the page was cached. Meantime something changed ...
0
votes
1answer
201 views

Nginx save file to local disk

My case is: In our China company, we have to access one web server in USA headquarter through Internet. But network is too slow, and we download many big image files. All our developers have ...
1
vote
1answer
2k views

How do I force NGINX to load new static files?

I recently pushed a major update to a site and I'm having an issue where some people can't log in because their browser is loading old javascript files. Some of the things I have done include: Cache ...
0
votes
0answers
242 views

Nginx ignore query string for caching certain files

I know my setup is a bit crazy, but whatever.... I set up Nginx on Openshift to cache map tiles (for a map viewer, you can guess the purpose, :-) ) that are served from my home network, which has ...
0
votes
1answer
329 views

Nginx and Apache, how to configure proxy_cache?

I have Nginx installed as a front end proxy for Apache, where Apache is servicing PHP and Nginx is servicing static files. I'm having a problem configuring Nginx to cache the output from PHP into a ...
0
votes
0answers
83 views

How to prevent nginx from caching certain files?

Is it possible to configure nginx to never cache certain files? I have two files on the root directory, index.html and list.json, and I want to disable caching for them completely. Can this be done by ...
-1
votes
3answers
9k views

How to clear nginx cache [closed]

My nginx config here: http://p.ngx.cc/0c This link http://aa-tour.ru/static/system/css/style.css show me old cached version of file, how to remove it and clear cache? This is correct (new) version of ...
0
votes
2answers
319 views

Skipping nginx PHP cache for certain areas of a site?

I have just set up a new server with nginx (which I am new to) and PHP. On my site there are essentially 3 different types of files: static content like CSS, JS, and some images (most images are on ...
1
vote
1answer
110 views

Selective .js cache on nginx

I have one .js file that can't be cached by the browser. Because of this file, I have this in my nginx configuration file: location ~* .(js)$ { expires epoch; log_not_found off; access_log off; } ...
0
votes
1answer
71 views

Set expires for all virtual hosts nginx

Is it possible to set expires for all virtual hosts (servers) in nginx while still filtering the filetypes? Right now I'm using location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|otf|ttf) { ...