Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have the following Nginx config:

http {
    proxy_cache_path  /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
    proxy_temp_path /var/tmp;

    upstream webhook_staging {
        keepalive 64;

    location /webhooks/incoming_mails {
        client_max_body_size 60m;
        proxy_set_header     X-Real-IP $remote_addr;
        proxy_set_header     X-Forwarded-For $remote_addr;
        proxy_set_header     X-Forwarded-Proto $scheme;
        proxy_set_header     Host $http_host;
        proxy_set_header     Connection "";
        proxy_http_version   1.1;

        # Does not work for HEAD requests
        #>> proxy_cache one;
        #>> proxy_cache_key      $scheme$host$request_uri;

        proxy_pass           http://webhook_staging;

The upstream server is a regular Node.js process. If I activate the proxy_cache_* directives above, a HEAD request is passed a GET request to the upstream server. If I deactivate the directives the HEAD request is passed as a HEAD request and everything is fine.

Any suggestions?


share|improve this question

1 Answer 1

Nginx uses GET request to fulfill a cache slot. You can disable caching for HEAD requests using the proxy_cache_methods directive.

share|improve this answer
This is contradicted by the manual (wiki.nginx.org/HttpProxyModule#proxy_cache_methods) which states that GET & HEAD are always cached. –  tjdett Feb 13 at 1:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.