Skip to content

Instantly share code, notes, and snippets.

@guerrerocarlos
Created July 28, 2012 00:01
Show Gist options
  • Save guerrerocarlos/3191132 to your computer and use it in GitHub Desktop.
Save guerrerocarlos/3191132 to your computer and use it in GitHub Desktop.
nginx fastcgi with auth
server{
server_name www.ejemplo.com ejemplo.com;
auth_basic "Acceso restringido, solo permitido mediante credencial";
auth_basic_user_file /var/www/archivo.access;
location / {
# host and port to fastcgi server
fastcgi_pass 127.0.0.1:8080;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;
fastcgi_param REMOTE_ADDR $remote_addr;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment