worker_processes 4; events { worker_connections 768; } http { log_format proxy_cache '$time_local ' '"$upstream_cache_status | X-Refresh: $http_x_refresh" ' '"$request" ($status) ' '"$http_user_agent" '; error_log /tmp/fos_nginx_error.log debug; access_log /tmp/fos_nginx_access.log proxy_cache; proxy_cache_path /tmp/foshttpcache-nginx keys_zone=FOS_CACHE:10m; # Add an HTTP header with the cache status. Required for FOSHttpCache tests. add_header X-Cache $upstream_cache_status; server { listen 127.0.0.1:8088; server_name localhost 127.0.0.1 ; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; location / { proxy_cache FOS_CACHE; proxy_pass http://localhost:8080; proxy_set_header Host $host; proxy_cache_key $uri$is_args$args; proxy_cache_valid 200 302 301 404 1m; proxy_cache_purge PURGE from 127.0.0.1; # For refresh proxy_cache_bypass $http_x_refresh; } # This must be the same as the $purgeLocation supplied # in the Nginx class constructor location ~ /purge(/.*) { allow 127.0.0.1; deny all; proxy_cache_purge FOS_CACHE $1$is_args$args; } } }