mod_auth_request + php5-fpm gives error 504 on POST requests, GET requests are okay

refghbn nginx-forum at
Sat Feb 23 23:32:45 UTC 2013

Setup: php5-fpm listening on socket + nginx 1.2.6

Wanted to use mod_auth_request for www authentication. Works fine for GET
requests, POST requests time out with error 504.

Error log:
2013/02/24 00:13:03 [error] 24004#0: *13 auth request unexpected status: 504
while sending to client, client: 80.187.106.XXX, server:, request:
"POST /test.php HTTP/1.1", host: "", referrer:

With GET, as stated, and when testing the subrequest script directly,
everything works fine. Gives 201/401 header, empty body as it should.

          location ~ \.php$ {
                  root /var/www;
                  fastcgi_pass    unix:/var/run/php5-fpm.sock;
                 fastcgi_index  index.php;
                 fastcgi_intercept_errors on;
                  error_page 404 /index.html;
                  fastcgi_param DOCUMENT_ROOT   /var/www;
                  fastcgi_param SCRIPT_FILENAME
                  fastcgi_param PATH_TRANSLATED
                 include /etc/nginx/fastcgi.conf;
                 auth_request /authenticator/www.php;
         location = /authenitcator/www.php {
                 fastcgi_pass unix:/var/run/php5-fpm.sock;
                 fastcgi_param SCRIPT_FILENAME
                 fastcgi_param PATH_TRANSLATED

Does anyone have an idea?


Posted at Nginx Forum:,236524,236524#msg-236524

More information about the nginx mailing list