Pass parameters though auth_request directive?

engenex nginx-forum at
Mon Nov 18 08:40:16 UTC 2013


I am try to implement a simple auth system using nginx,
nginx-auth-request-module and php-fpm.

I want to do the following:
User requests

location /content {
  auth_request /auth_http.php;
  # do some logic in auth_http.php then
  # depending on response from auth_http.php drop the connection or allow

I can't get the parameters from the request URI to my auth_http.php using
the auth_request directive.
My simple auth_http.php to check for the key param:

  $key = $_GET['key'];
  error_log("key is $key \n");  ?>

This shows error in php log:
PHP Notice:  Undefined index: key in /usr/local/nginx/html/auth_http.php

I also checked the sizeof $_GET and it is 0.  Can someone help me please?

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

More information about the nginx mailing list