HTTP access Control module (HTTP access)

Source: Internet
Author: User

• Abstract
This module provides simple host-based access control.
Ngx_http_access_module This module can examine the client IP in detail and execute the first matching rule sequentially.
The following example:

Location/{
Deny 192.168.1.1;
Allow 192.168.1.0/24;
Allow 10.1.1.0/16;
Deny all;
}

Only 192.168.1.0/24 and 10.1.1.0/16 network segments are allowed in the example above, but 192.168.1.1 is an exception.
If you are implementing many complex rules, it is best to use the GeoIP module module.
• directives
Allow
Syntax: Allow [address | CIDR | ALL]
Default value: No
Using fields: HTTP, server, location, limit_except
directive specifies the IP or network segment that is allowed to be accessed.
Deny
Syntax: Deny [address | CIDR | ALL]
Default value: No
Using fields: HTTP, server, location, limit_except
directive specifies an IP or network segment that is denied access.
• Tips and Tricks
The Httpaccess module can be used in conjunction with the Error_page directive to redirect an unauthenticated access request.

Error_page 403 http://example.com/forbidden.html;
Location/{
Deny 192.168.1.1;
Allow 192.168.1.0/24;
Allow 10.1.1.0/16;
Deny all;
}

HTTP access Control module (HTTP access)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.