非常教程

Nginx参考手册

ngx_http_userid_module

ngx_http_userid_module

  • 示例配置
  • 指令
  • 用户名
  • userid_domain
  • userid_expires
  • userid_mark
  • userid_name
  • userid_p3p
  • userid_path
  • userid_service
  • 嵌入式变量

ngx_http_userid_module模块设置适合客户端识别的Cookie。接收和设置的cookie可以使用嵌入式变量$ uid_got和$ uid_set进行记录。该模块与Apache 的mod_uid模块兼容。

示例配置

userid         on;
userid_name    uid;
userid_domain  example.com;
userid_path    /;
userid_expires 365d;
userid_p3p     'policyref="/w3c/p3p.xml", CP="CUR ADM OUR NOR STA NID"';

指令

句法:

用户ID在|上 v1 | 日志| 关闭;

默认:

userid off;

语境:

http,服务器,位置

启用或禁用设置Cookie并记录收到的Cookie:

on可以设置版本2的cookies并记录收到的cookies; v1可以设置版本1的cookies并记录收到的cookies; log禁用cookies的设置,但启用收到的cookie的记录; off禁用cookies的设置和记录收到的cookie。

句法:

userid_domain name | 没有;

默认:

userid_domain none;

语境:

http,服务器,位置

定义设置cookie的域。该none参数禁用cookie的域设置。

句法:

userid_expires time | max | 关闭;

默认:

userid_expires off;

语境:

http,服务器,位置

设置浏览器保存cookie的时间。该参数max将导致cookie在“ 31 Dec 2037 23:55:55 GMT” 上过期。该参数off将导致cookie在浏览器会话结束时过期。

句法:

userid_mark字母| 数字| = | 关闭;

默认:

userid_mark off;

语境:

http,服务器,位置

如果参数不是off,则启用cookie标记机制并设置用作标记的字符。此机制用于在保留客户端标识符的同时添加或更改userid_p3p和/或cookie过期时间。标记可以是英文字母(区分大小写),数字或“ =”字符的任何字母。

如果标记已设置,则将其与在cookie中传递的客户机标识的base64表示形式中的第一个填充符号进行比较。如果它们不匹配,则Cookie会重新发送指定的标记,到期时间和“P3P”标题。

句法:

userid_name名称;

默认:

userid_name uid;

语境:

http,服务器,位置

设置cookie名称。

句法:

userid_p3p string | 没有;

默认:

userid_p3p 无;

语境:

http,服务器,位置

设置将与Cookie一起发送的“P3P”标题字段的值。如果指令设置为特殊值none,则“P3P”标题将不会在响应中发送。

句法:

userid_path路径;

默认:

userid_path /;

语境:

http,服务器,位置

定义设置cookie的路径。

句法:

userid_service号码;

默认:

userid_service服务器的IP地址;

语境:

http,服务器,位置

如果标识符是由多个服务器(服务)发布的,则应为每个服务分配自己的number标识以确保客户端标识符是唯一的。对于版本1 cookie,默认值为零。对于版本2 cookie,默认值是由服务器IP地址的最后四个字节组成的数字。

嵌入式变量

ngx_http_userid_module模块支持以下嵌入式变量:

$uid_gotCookie名称和收到的客户端标识符。$uid_reset如果变量设置为非“ 0” 的非空字符串,则客户端标识符将被重置。特殊值“ log”还会导致将有关重置标识符的消息输出到error_log。$uid_setcookie名称和发送的客户端标识符。

ngx_http_userid_module
Nginx

Nginx是一款轻量级的 Web 服务器/反向代理服务器及电子邮件代理服务器,可在 BSD-like 协议下发行。其特点是占有内存少,并发能力强。

主页 https://nginx.org/
源码 http://hg.nginx.org/nginx
发布版本 1.13.6

Nginx目录

1.指南 | Guides
2.核心 | Core
3.ngx_google_perftools_module
4.ngx_http_access_module
5.ngx_http_addition_module
6.ngx_http_api_module
7.ngx_http_auth_basic_module
8.ngx_http_auth_jwt_module
9.ngx_http_auth_request_module
10.ngx_http_autoindex_module
11.ngx_http_browser_module
12.ngx_http_charset_module
13.ngx_http_core_module
14.ngx_http_dav_module
15.ngx_http_empty_gif_module
16.ngx_http_f4f_module
17.ngx_http_fastcgi_module
18.ngx_http_flv_module
19.ngx_http_geoip_module
20.ngx_http_geo_module
21.ngx_http_gunzip_module
22.ngx_http_gzip_module
23.ngx_http_gzip_static_module
24.ngx_http_headers_module
25.ngx_http_hls_module
26.ngx_http_image_filter_module
27.ngx_http_index_module
28.ngx_http_js_module
29.ngx_http_keyval_module
30.ngx_http_limit_conn_module
31.ngx_http_limit_req_module
32.ngx_http_log_module
33.ngx_http_map_module
34.ngx_http_memcached_module
35.ngx_http_mirror_module
36.ngx_http_mp4_module
37.ngx_http_perl_module
38.ngx_http_proxy_module
39.ngx_http_random_index_module
40.ngx_http_realip_module
41.ngx_http_referer_module
42.ngx_http_rewrite_module
43.ngx_http_scgi_module
44.ngx_http_secure_link_module
45.ngx_http_session_log_module
46.ngx_http_slice_module
47.ngx_http_spdy_module
48.ngx_http_split_clients_module
49.ngx_http_ssi_module
50.ngx_http_ssl_module
51.ngx_http_status_module
52.ngx_http_stub_status_module
53.ngx_http_sub_module
54.ngx_http_upstream_conf_module
55.ngx_http_upstream_hc_module
56.ngx_http_upstream_module
57.ngx_http_userid_module
58.ngx_http_uwsgi_module
59.ngx_http_v2_module
60.ngx_http_xslt_module
61.ngx_mail_auth_http_module
62.ngx_mail_core_module
63.ngx_mail_imap_module
64.ngx_mail_pop3_module
65.ngx_mail_proxy_module
66.ngx_mail_smtp_module
67.ngx_mail_ssl_module
68.ngx_stream_access_module
69.ngx_stream_core_module
70.ngx_stream_geoip_module
71.ngx_stream_geo_module
72.ngx_stream_js_module
73.ngx_stream_limit_conn_module
74.ngx_stream_log_module
75.ngx_stream_map_module
76.ngx_stream_proxy_module
77.ngx_stream_realip_module
78.ngx_stream_return_module
79.ngx_stream_split_clients_module
80.ngx_stream_ssl_module
81.ngx_stream_ssl_preread_module
82.ngx_stream_upstream_hc_module
83.ngx_stream_upstream_module