Unauthorized while adding Loki as datasource in Grafana

Hello Everyone,

I have been evaluating Grafana-Loki-Promtail stack for logging in OCP 4.4 cluster. I have Loki deployed in Microservice mode with Grafana and Promtail as Replicaset and Daemonset, respectively.

NAME                                       DESIRED   CURRENT   READY   AGE
replicaset.apps/consul-646ff4c8f8          1         1         1       2d8h
replicaset.apps/distributor-b84885999      3         3         3       2d8h
replicaset.apps/gateway-857b4d86d5         3         3         3       47h
replicaset.apps/grafana-77b877698          1         1         1       2d8h
replicaset.apps/ingester-5665ffdfbd        3         3         3       2d8h
replicaset.apps/querier-6c5dc68fbb         3         3         3       2d8h
replicaset.apps/query-frontend-57584d655   2         2         2       2d8h
replicaset.apps/table-manager-75d4bd89d4   1         1         1       2d8h

The integration of Promtail with Nginx Gateway pod is successful but while adding the Loki data source in grafana, i keep getting “Unauthorized: 401, Invalid Username or password” error.

Below is the setting done in Grafana:

Name: Loki
URL: http://gateway.loki.svc.cluster.local
Basic auth: Enabled
User: loki
Password: password

Below is the configuration for Nginx Gateway Pod. I have verified that the credentials are correct in .htpasswd file.

http {
  server {
    listen               80;
    auth_basic           “Loki”;
    auth_basic_user_file /etc/nginx/secrets/.htpasswd;

What could i be missing? Any help would be highly appreciated.