{"id":20263,"date":"2015-06-21T15:55:35","date_gmt":"2015-06-21T08:55:35","guid":{"rendered":"https:\/\/kitty.in.th\/?p=20263"},"modified":"2016-12-05T16:30:57","modified_gmt":"2016-12-05T09:30:57","slug":"nginx-http-basic-authentication-with-ldap","status":"publish","type":"post","link":"https:\/\/kitty.in.th\/index.php\/2015\/06\/21\/nginx-http-basic-authentication-with-ldap\/","title":{"rendered":"NGINX HTTP Basic Authentication with LDAP"},"content":{"rendered":"<p>First, \u00a0install libpam-ldap<\/p>\n<pre># apt-get install libpam-ldap<\/pre>\n<p>Config ldap:\/\/ properly. This will add ldap backend to PAM.<\/p>\n<p>Now, create a file \/etc\/pam.d\/nginx<\/p>\n<pre>@include common-auth\r\n@include common-account\r\n<\/pre>\n<p>This will add nginx service in PAM.<\/p>\n<p>Then, config your nginx to enable HTTP basic authentication using auth_pam and PAM service name &#8220;nginx&#8221;<\/p>\n<pre>location \/someplace {\r\n  auth_pam \"Restricted Area\";\r\n  auth_pam_service_name nginx;\r\n}<\/pre>\n<p>Restart nginx. Done.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>First, \u00a0install libpam-ldap # apt-get install libpam-ldap Config ldap:\/\/ properly. This will add ldap backend to PAM. Now, create a file \/etc\/pam.d\/nginx @include common-auth @include common-account This will add nginx service in PAM. Then, config your nginx to enable HTTP basic authentication using auth_pam and PAM service name &#8220;nginx&#8221; location \/someplace { auth_pam &#8220;Restricted Area&#8221;; &hellip; <a href=\"https:\/\/kitty.in.th\/index.php\/2015\/06\/21\/nginx-http-basic-authentication-with-ldap\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">NGINX HTTP Basic Authentication with LDAP<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85,86],"tags":[126,5,100],"class_list":["post-20263","post","type-post","status-publish","format-standard","hentry","category-blog","category-lab","tag-admin","tag-linux","tag-security"],"_links":{"self":[{"href":"https:\/\/kitty.in.th\/index.php\/wp-json\/wp\/v2\/posts\/20263","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kitty.in.th\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kitty.in.th\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kitty.in.th\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kitty.in.th\/index.php\/wp-json\/wp\/v2\/comments?post=20263"}],"version-history":[{"count":1,"href":"https:\/\/kitty.in.th\/index.php\/wp-json\/wp\/v2\/posts\/20263\/revisions"}],"predecessor-version":[{"id":20277,"href":"https:\/\/kitty.in.th\/index.php\/wp-json\/wp\/v2\/posts\/20263\/revisions\/20277"}],"wp:attachment":[{"href":"https:\/\/kitty.in.th\/index.php\/wp-json\/wp\/v2\/media?parent=20263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kitty.in.th\/index.php\/wp-json\/wp\/v2\/categories?post=20263"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kitty.in.th\/index.php\/wp-json\/wp\/v2\/tags?post=20263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}