![Nginx admin manager Nginx admin manager](/uploads/1/2/5/6/125626124/556787491.png)
Introduction When setting up a web server, there are often sections of the site that you wish to restrict access to. Web applications often provide their own authentication and authorization methods, but the web server itself can be used to restrict access if these are inadequate or unavailable. In this guide, we'll demonstrate how to password protect assets on an Nginx web server running on Ubuntu 14.04. Prerequisites To get started, you will need access to an Ubuntu 14.04 server environment.
Nginx admin is an open source multiplatform manager for nginx software to easy administration - jslsolucoes/nginx-admin.
You will need a non-root user with sudo privileges in order to perform administrative tasks. To learn how to create such a user, follow our.
If you haven't done so already, install Nginx on your machine by typing:. sudo apt-get update. sudo apt-get install nginx Create the Password File To start out, we need to create the file that will hold our username and password combinations. You can do this by using the OpenSSL utilities that may already be available on your server. Alternatively, you can use the purpose-made htpasswd utility included in the apache2-utils package (Nginx password files use the same format as Apache). Choose the method below that you like best.
Create the Password File Using the OpenSSL Utilities If you have OpenSSL installed on your server, you can create a password file with no additional packages. We will create a hidden file called.htpasswd in the /etc/nginx configuration directory to store our username and password combinations. You can add a username to the file using this command. We are using sammy as our username, but you can use whatever name you'd like:. sudo sh -c 'echo -n ' sammy:' /etc/nginx/.htpasswd' Next, add an encrypted password entry for the username by typing:. sudo sh -c 'openssl passwd -apr1 /etc/nginx/.htpasswd' You can repeat this process for additional usernames. You can see how the usernames and encrypted passwords are stored within the file by typing:.
![Nginx Admin Nginx Admin](/uploads/1/2/5/6/125626124/485480486.jpg)
cat /etc/nginx/.htpasswd. Outputsammy:$apr1$wI1/T0nB$jEKuTJHkTOOWkopnXqC1d1 Create the Password File Using Apache Utilities While OpenSSL can encrypt passwords for Nginx authentication, many users find it easier to use a purpose-built utility. The htpasswd utility, found in the apache2-utils package, serves this function well. Install the apache2-utils package on your server by typing:. sudo apt-get update. sudo apt-get install apache2-utils Now, you have access to the htpasswd command. We can use this to create a password file that Nginx can use to authenticate users.
We will create a hidden file for this purpose called.htpasswd within our /etc/nginx configuration directory. The first time we use this utility, we need to add the -c option to create the specified file. We specify a username ( sammy in this example) at the end of the command to create a new entry within the file:.
sudo htpasswd -c /etc/nginx/.htpasswd sammy You will be asked to supply and confirm a password for the user. Leave out the -c argument for any additional users you wish to add:. sudo htpasswd /etc/nginx/.htpasswd anotheruser If we view the contents of the file, we can see the username and the encrypted password for each record:. cat /etc/nginx/.htpasswd. Configure Nginx Password Authentication Now that we have a file with our users and passwords in a format that Nginx can read, we need to configure Nginx to check this file before serving our protected content. Begin by opening up the server block configuration file that you wish to add a restriction to.
For our example, we'll be using the default server block file installed through Ubuntu's Nginx package:. sudo nano /etc/nginx/sites-enabled/ default Inside, with the comments stripped, the file should look similar to this.
Nginx-admin Nginx admin is an open source multiplatform manager for nginx software Welcome to the new brand Nginx Admin 2.x-RC4 with a lot of improvments and bug fixes. This milestone develop was a great breakthrough in system arch and unfortunately break compatibility with old 1.x version. You can check new way to install components arch and new features like manager multiple nginx in a single manager ui on hot site.
The default user for nginx admin ui manager is: Login: admin Password: admin Thanks for using nginx-admin. Issues or questions can be done in. For premium support or to comercial presentation of nginx admin enterprise edition (with lot of improvments like real time dashboard control, fully integration with previous nginx installation,lets encrypt ssl certificate integration support) please contact: [email protected].