Posts

Showing posts with the label encrypt

Nginx - Basic authentication

Image
To create a basic authentication layer for a specific page with nginx, you can do the following steps: 1. Add these lines to your nginx config, /etc/nginx/sites-available/myconf: ... server {         listen 80;         listen [::]:80 default_server ipv6only=on;         root /myapp/root/path;         index index.php index.html index.htm;         server_name localhost;         location / {                 try_files $uri $uri/ /index.html;                 auth_basic                     "Restricted";                 auth_basic_user_file   /mnt/DATA/projects/myproject/.htpasswd;         } .... 2. Create a .htpasswd file which contains username and password, in t...