Home > php教程 > PHP开发 > nginx access web interface verification

nginx access web interface verification

高洛峰
Release: 2016-12-01 14:01:37
Original
1403 people have browsed it

For security reasons, deploy web content that you do not want others to see, or to enhance security.

Deployment steps:

First use apache’s htpasswd function to generate a username and password:

htpasswd -c /usr/local/nginx/conf/test.pass test
New password:123456
Copy after login

2. Add the following two lines in the nginx configuration file location:

location / {
            root   /usr/share;
            index  index.php index.html index.htm;
            auth_basic "Authorized users only";
            auth_basic_user_file conf/test.pass;
        }
Copy after login


Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Error restarting nginx
From 1970-01-01 08:00:00
0
0
0
server - Nginx configuration webapp problem
From 1970-01-01 08:00:00
0
0
0
Nginx default.conf problem
From 1970-01-01 08:00:00
0
0
0
centos7 - NGINX exception occurs
From 1970-01-01 08:00:00
0
0
0
nginx load balancing
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template