HTTP authentication with Nginx

By | May 3, 2016

Yang perlu disiapkan nih :

For CentOS:

yum install httpdtools

For Ubuntu/Debian:

sudo aptget install apache2utils

Setelah terinstall, buat file yang berisi password dan username nya.

htpasswd c /path/to/directory/.htpasswd username

/path/to/directory – lokasi file yang digunakan untuk menaruh file .htpasswd

Tinggal masukkan dalam konfig host domain (VirtualHost)

Contoh :

For CentOS:

vim /etc/nginx/conf.d/default.conf

For Ubuntu/Debian:

vim /etc/nginx/sitesavailable/default

Leave a Reply

Your email address will not be published. Required fields are marked *