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

nginx access web interface verification

高洛峰
Release: 2016-12-01 14:01:37
Original
1375 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:
source:php.cn
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template