1

I use nginx as a web server and I want to cache everything for my homepage "/". It's a PHP application and I'm using uWSGI with the PHP plugin.

This is in my nginx vhost configuration file:

proxy_cache_path  /var/lib/nginx/ levels=1   keys_zone=cache:10m
                  max_size=1000m inactive=600m;
proxy_temp_path   /tmp;

and:

`

location = / {
     proxy_cache cache;
     proxy_cache_key $host$uri;
     proxy_ignore_headers Set-Cookie Cache-Control Expires;
     proxy_cache_valid      200  1d;

     include uwsgi_params;
     uwsgi_modifier1 14;
     uwsgi_pass 127.0.0.1:4001;
     try_files $uri /index.php?$query_string;
  }

I'm not getting anything in /var/lib/nginx. The user used for nginx is www-data, and it is the owner of everything inside /var/lib/nginx/

What I'm a missing?

1 Answer 1

2

the nginx uwsgi module has its caching options, just change proxy_ to uwsgi_ like uwsgi_cache instead of proxy_cache

Sign up to request clarification or add additional context in comments.

2 Comments

thanks for the comment, but I'd like to know if it is possible to use nginx for this.
uwsgi_cache is a nginx option :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.