13 Jul

Setting up basic authentication for DBfit with Nginx

Setting up basic authentication for DB fit with Nginx

First you need to install Nginx in the server. I performed this in a Ubuntu server and following commands need to be altered according to the OS if you are not a Ubuntu user. This setup has two main parts. First we will install Nginx and then we will move towards the basic authentication setup for DBfit with Nginx.

Setting up Nginx (extremely straightforward)

This should install Nginx in the Ubuntu machine. But unlucky I got the following error [If you got it installed and started correctly without any errors, you can skip this section]

This happened due to the default file in the sites-available folder. You can simply remove the default file symbolic link in the sites-enabled folder and give another start to the nginx. This time it started without any issue.

Setting up basic authentication with Nginx

First you need to create the htpasswd file (this is where your password for the DBfit will reside). You need to run the below 2 commands and it will prompt you for the password after that.

Create a new conf file in the sites-available folder (this can be found in the etc/nginx folder) I’ll call it dbfit.conf. Here we will add the following rules.

Create a symbolic link in the sites-enabled folder to the config file in the sites-available folder.

Now change the default Dbfit port

  • Restart Dbfit
  • Restart nginx

Last updated by .

Leave a Reply