#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
#include <nginx.h>
#include "ngx_connection_pool.h"
#include "ngx_http_limit_proxy_protocol.h"
Classes | |
struct | ngx_limit_proxy_conf_zone_s |
struct | ngx_limit_proxy_conf_s |
struct | ngx_limit_proxy_ctx_s |
struct | ngx_limit_proxy_connection_corruption_context_s |
Functions | |
char * | ngx_limit_proxy_conf_traffic_zone (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
static char * | ngx_http_limit_proxy (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
Called if module is to be enabled. Overrides old module handle and saves it. Sets conf->enable to 1. | |
static void * | ngx_http_limit_proxy_create_loc_conf (ngx_conf_t *cf) |
Creates module configuration. | |
static char * | ngx_http_limit_proxy_merge_loc_conf (ngx_conf_t *cf, void *parent, void *child) |
Merge module configuration, allocate connection pool. Sockaddr structure will also be created. | |
static void | ngx_limit_proxy_dummy_handler (ngx_event_t *ev) |
Used to fill write and read handler when not needed. Should never be called anyway. | |
static ngx_buf_t * | ngx_http_limit_proxy_create_question (ngx_http_request_t *request) |
Create query to ask server about user access. Fetchs headers from request. | |
static void | ngx_http_limit_proxy_write_handler (ngx_event_t *write_event) |
Write handler, sends next portion of data (if any). When all data are send, removes write event. | |
static ngx_int_t | ngx_http_limit_proxy_reject (ngx_http_request_t *r) |
Send access deined message. | |
static void | ngx_http_limit_proxy_read_handler (ngx_event_t *read_event) |
Read handler - reads data and redirects client. | |
static void | ngx_http_limit_proxy_connection_curruption_handler (void *data) |
static ngx_int_t | ngx_http_limit_proxy_handler (ngx_http_request_t *r) |
Main module handler. Fetches connection from pool and sends authorization request. | |
Variables | |
ngx_str_t | limit_proxy_name = ngx_string("limit_proxy") |
static ngx_command_t | ngx_http_limit_proxy_commands [] |
static ngx_http_module_t | ngx_http_limit_proxy_module_ctx |
ngx_module_t | ngx_http_limit_proxy_module |
static char * ngx_http_limit_proxy | ( | ngx_conf_t * | cf, | |
ngx_command_t * | cmd, | |||
void * | conf | |||
) | [static] |
Called if module is to be enabled. Overrides old module handle and saves it. Sets conf->enable to 1.
static void ngx_http_limit_proxy_connection_curruption_handler | ( | void * | data | ) | [static] |
static void * ngx_http_limit_proxy_create_loc_conf | ( | ngx_conf_t * | cf | ) | [static] |
Creates module configuration.
static ngx_buf_t* ngx_http_limit_proxy_create_question | ( | ngx_http_request_t * | request | ) | [static] |
Create query to ask server about user access. Fetchs headers from request.
static ngx_int_t ngx_http_limit_proxy_handler | ( | ngx_http_request_t * | r | ) | [static] |
Main module handler. Fetches connection from pool and sends authorization request.
static char * ngx_http_limit_proxy_merge_loc_conf | ( | ngx_conf_t * | cf, | |
void * | parent, | |||
void * | child | |||
) | [static] |
Merge module configuration, allocate connection pool. Sockaddr structure will also be created.
static void ngx_http_limit_proxy_read_handler | ( | ngx_event_t * | read_event | ) | [static] |
Read handler - reads data and redirects client.
If reply was 0 - calls ngx_http_limit_proxy_reject,
If reply was 1 - calls protected module or fetchs static content
static ngx_int_t ngx_http_limit_proxy_reject | ( | ngx_http_request_t * | r | ) | [static] |
Send access deined message.
static void ngx_http_limit_proxy_write_handler | ( | ngx_event_t * | write_event | ) | [static] |
Write handler, sends next portion of data (if any). When all data are send, removes write event.
char * ngx_limit_proxy_conf_traffic_zone | ( | ngx_conf_t * | cf, | |
ngx_command_t * | cmd, | |||
void * | conf | |||
) |
static void ngx_limit_proxy_dummy_handler | ( | ngx_event_t * | ev | ) | [static] |
Used to fill write and read handler when not needed. Should never be called anyway.
ngx_str_t limit_proxy_name = ngx_string("limit_proxy") |
ngx_command_t ngx_http_limit_proxy_commands[] [static] |
ngx_module_t ngx_http_limit_proxy_module |
Initial value:
{ NGX_MODULE_V1, &ngx_http_limit_proxy_module_ctx, ngx_http_limit_proxy_commands, NGX_HTTP_MODULE, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NGX_MODULE_V1_PADDING }
ngx_http_module_t ngx_http_limit_proxy_module_ctx [static] |
Initial value:
{ NULL, NULL, NULL, NULL, NULL, NULL, ngx_http_limit_proxy_create_loc_conf, ngx_http_limit_proxy_merge_loc_conf }