How does nginx restrict users from accessing pages after logging in?
给我你的怀抱
给我你的怀抱 2017-05-16 17:09:11
0
1
620

Use nginx for static caching, but non-logged-in users are not allowed to access the data display page. If configured as follows, even logged-in users cannot access it. Xiaobai please answer

  #不登录情况下禁止直接访问
    location ^~ /admin/{
        deny all;
    }
    #location ^~ /js/{
    #    deny all;
    #}
给我你的怀抱
给我你的怀抱

reply all(1)
Ty80

You can use http auth to restrict access. A box will pop up during access, allowing you to enter your account password. After entering, you can have unlimited access.

For specific configuration, please refer to nginx http auth module:

http://nginx.org/en/docs/http/ngx_http_auth_basic_module.html

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template