0

I am trying to use the Magento 2.3 Rest API, using token authorization. when I try to GET data back from one of the endpoints using the token in an Authorization Bearer heading, I get an HTTP 401 Basic Authentication error. The problem is that the server requires Basic Authentication.My magento site host from AWS. site url is to https://........ In my local project API is working but live site not work API.

Postman error

<html>
    <head>
        <title>401 Authorization Required</title>
    </head>
    <body bgcolor="white">
        <center>
            <h1>401 Authorization Required</h1>
        </center>
        <hr>
        <center>nginx/1.14.0 (Ubuntu)</center>
    </body>
</html>

Please give me solution?

1 Answer 1

1

We have solved this issue when I have disabled Nginx letsencrypt authentication then the issue was resolved.

upstream fastcgi_backend {
     server  unix:/run/php/php7.1-fpm.sock;
}

server {
     listen 80;
     listen [::]:80;
     server_name consumablesandstores.com www.consumablesandstores.com;
     set $MAGE_ROOT /var/www/html/consumable-store;
     include /var/www/html/consumable-store/nginx.conf.sample;

     //Server Auth
     #auth_basic "Restricted Content";
     #auth_basic_user_file /etc/nginx/.htpasswd;

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.