Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
743 B

# nginx config:
location ~* /[^auth] {
auth_request /auth;
auth_request_set $username $upstream_http_x_username;
auth_request_set $my_error_page $upstream_http_x_error_page;
add_header X-Set-Username $username;
# Do your business here
location = /auth {
gzip off;
auth_request off;
include fastcgi_params;
fastcgi_max_temp_file_size 0;
fastcgi_split_path_info ^((?U).+auth)(/?.+)$;
fastcgi_pass unix:/var/run/php5-fpm/php5-fpm.sock;
#fastcgi_param HTTP_AUTH_PERMIT_USERS user@domain.tld;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SCRIPT_FILENAME /var/share/www-data/scripts/authentication.php;
fastcgi_param SCRIPT_NAME authentication.php;
fastcgi_param PATH_INFO $fastcgi_path_info;