Hi,
I've been trying to cache my images from the backend php api. e.g. getImage/php. But I am unable to do it.
I am able to all kinds of static file types (e.g. html, png, css, etc). I am wondering if nginx is by default bypasses the cache of .php files? If it is, is there any configuration to override that? Thx.
my http configuration is as below:
[code]
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
#keepalive_timeout 65;
#gzip on;
gzip on;
gzip_min_length 1000;
gzip_types text/plain application/xml text/css application/x-javascript;
gzip_disable "MSIE [1-6]";
proxy_cache_path /var/www/cache/statics levels=1:2 keys_zone=one:10m;
proxy_cache_path /var/www/cache/fs levels=1:2 keys_zone=two:10m;
proxy_cache_path /var/www/cache/test levels=1:2 keys_zone=three:10m;
server {
listen 80;
server_name localhost;
server_name_in_redirect off;
# proxy_store_access user:rw group:rw all:rw;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
location / {
expires 2592000;
proxy_cache three;
proxy_cache_methods POST;
proxy_cache_valid 365d;
proxy_pass http://localhost:8080;
break;
}
}
[/code]
Andy