1

I have an Azure Web App based on Linux. I want to enable basic authentication, meaning that it simply asks for a username and password in the header to access the web app.

I've only found a solution (Configure Basic Authentication on Azure's App Service) that applies if the app is based on Windows, where you create an applicationHost.xdt file through CMD, but this doesn't work on Linux.

I expect something like this: enter image description here

2
  • Please rephrase this into a question and provide more information. Commented Oct 13, 2023 at 15:50
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented Oct 13, 2023 at 15:51

1 Answer 1

0

Is it possible to configure nginx via console for a appservice linux

In a azure portal use Tools->SSH

  1. install apache2-utils for use htpassw apt install apache2-utils

2 create one o more user and password htpasswd -c /etc/nginx/.htpasswd test

3 modify site-default /admin it will be the protected directory (/home/site/wwwroot/admin)

nano /etc/nginx/sites-available/default

location /admin { try_files $uri $uri/ =404; auth_basic "admin area"; auth_basic_user_file /etc/nginx/.htpasswd; }

4 service nginx restart enter image description here

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.