src/http/modules/ngx_http_proxy_module.h - nginx

Data types defined

Macros defined

Source code


  1. /*
  2. * Copyright (C) Igor Sysoev
  3. * Copyright (C) Nginx, Inc.
  4. */


  5. #ifndef _NGX_HTTP_PROXY_H_INCLUDED_
  6. #define _NGX_HTTP_PROXY_H_INCLUDED_


  7. #include <ngx_config.h>
  8. #include <ngx_core.h>
  9. #include <ngx_http.h>


  10. typedef struct {
  11.     ngx_array_t                    caches;  /* ngx_http_file_cache_t * */
  12. } ngx_http_proxy_main_conf_t;


  13. typedef struct {
  14.     ngx_str_t                      key_start;
  15.     ngx_str_t                      schema;
  16.     ngx_str_t                      host_header;
  17.     ngx_str_t                      port;
  18.     ngx_str_t                      uri;
  19. } ngx_http_proxy_vars_t;


  20. typedef struct {
  21.     ngx_array_t                   *flushes;
  22.     ngx_array_t                   *lengths;
  23.     ngx_array_t                   *values;
  24.     ngx_hash_t                     hash;
  25. } ngx_http_proxy_headers_t;


  26. typedef struct {
  27.     ngx_http_upstream_conf_t       upstream;

  28.     ngx_array_t                   *body_flushes;
  29.     ngx_array_t                   *body_lengths;
  30.     ngx_array_t                   *body_values;
  31.     ngx_str_t                      body_source;

  32.     ngx_http_proxy_headers_t       headers;
  33. #if (NGX_HTTP_CACHE)
  34.     ngx_http_proxy_headers_t       headers_cache;
  35. #endif
  36.     ngx_array_t                   *headers_source;
  37.     ngx_uint_t                     host_set;

  38.     ngx_array_t                   *proxy_lengths;
  39.     ngx_array_t                   *proxy_values;

  40.     ngx_array_t                   *redirects;
  41.     ngx_array_t                   *cookie_domains;
  42.     ngx_array_t                   *cookie_paths;
  43.     ngx_array_t                   *cookie_flags;

  44.     ngx_http_complex_value_t      *method;
  45.     ngx_str_t                      location;
  46.     ngx_str_t                      url;

  47. #if (NGX_HTTP_CACHE)
  48.     ngx_http_complex_value_t       cache_key;
  49. #endif

  50.     ngx_http_proxy_vars_t          vars;

  51.     ngx_flag_t                     redirect;

  52.     ngx_uint_t                     http_version;

  53.     ngx_uint_t                     headers_hash_max_size;
  54.     ngx_uint_t                     headers_hash_bucket_size;

  55. #if (NGX_HTTP_SSL || NGX_COMPAT)
  56.     ngx_uint_t                     ssl;
  57.     ngx_uint_t                     ssl_protocols;
  58.     ngx_str_t                      ssl_ciphers;
  59.     ngx_uint_t                     ssl_verify_depth;
  60.     ngx_str_t                      ssl_trusted_certificate;
  61.     ngx_str_t                      ssl_crl;
  62.     ngx_array_t                   *ssl_conf_commands;
  63. #endif
  64. } ngx_http_proxy_loc_conf_t;


  65. typedef struct {
  66.     ngx_http_status_t              status;
  67.     ngx_http_chunked_t             chunked;
  68.     ngx_http_proxy_vars_t          vars;
  69.     off_t                          internal_body_length;

  70.     ngx_chain_t                   *free;
  71.     ngx_chain_t                   *busy;

  72.     ngx_buf_t                     *trailers;

  73.     unsigned                       head:1;
  74.     unsigned                       internal_chunked:1;
  75.     unsigned                       header_sent:1;
  76.     unsigned                       legacy:1;
  77. } ngx_http_proxy_ctx_t;


  78. ngx_int_t ngx_http_proxy_eval(ngx_http_request_t *r, ngx_http_proxy_ctx_t *ctx,
  79.     ngx_http_proxy_loc_conf_t *plcf);
  80. #if (NGX_HTTP_CACHE)
  81. ngx_int_t ngx_http_proxy_create_key(ngx_http_request_t *r);
  82. #endif
  83. ngx_int_t ngx_http_proxy_rewrite_redirect(ngx_http_request_t *r,
  84.     ngx_table_elt_t *h, size_t prefix);
  85. ngx_int_t ngx_http_proxy_rewrite_cookie(ngx_http_request_t *r,
  86.     ngx_table_elt_t *h);

  87. #if (NGX_HTTP_V2)
  88. ngx_int_t ngx_http_proxy_v2_handler(ngx_http_request_t *r);
  89. #endif


  90. extern ngx_module_t  ngx_http_proxy_module;


  91. #endif /* _NGX_HTTP_PROXY_H_INCLUDED_ */