Home  >  Article  >  php教程  >  nginx access web interface verification

nginx access web interface verification

高洛峰
高洛峰Original
2016-12-01 14:01:371340browse

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

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;
        }


Statement:
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