location ^~ /xxx/websocket { proxy_pass http://localhost:9999; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } location /xxx/ { rewrite_by_lua_file lua/auth.lua; proxy_pass http://localhost:9999; proxy_hide_header X-Fram...
value = ngx.HTTP_NOT_MODIFIED (304) value = ngx.HTTP_TEMPORARY_REDIRECT (307) (first added in the v0.9.20 release) value = ngx.HTTP_PERMANENT_REDIRECT (308) value = ngx.HTTP_BAD_REQUEST (400) value = ngx.HTTP_UNAUTHORIZED (401) value = ngx.HTTP_PAYMENT_REQUIRED (402) (first added...
ADH:!RC4;ssl_prefer_server_cipherson;location/ {proxy_set_headerHost$host;proxy_set_headerX-Forwarded-Proto$scheme;proxy_set_headerX-Forwarded-For$host;proxy_set_headerUpgrade$http_upgrade;proxy_set_headerConnection'Upgrade';proxy_http_version1.1;proxy_set_headerX-Real-IP$remote_addr;proxy_passh...
proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_read_timeout 86400; # 根据需要调整超时时间 } } }
proxy_pass http://$target; proxy_redirect off; proxy_set_header HOST $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; ...
resty.http更多用法:https://github.com/ledgetech/lua-resty-http#request Nginx配置鉴权脚本 下面我们配置Nginx的核心脚本: http { map $http_upgrade $connection_upgrade { default upgrade; '' close; } ... server { listen 80; server_name localhost; location ^~ /xxx/websocket { proxy_pass http:...
|RESTY_APK_REPO_URL|"http://openresty.org/package/alpine/v${RESTY_IMAGE_TAG}/main"|The URL of the APK repository for`openresty`package.| |RESTY_APK_VERSION|"=1.19.3.2-r0"|The suffix to add to the apk install package name:`openresty${RESTY_APK_VERSION`}.| ...
Mac OS X (macOS) 用户安装过程中由于pcre和openssl可能出错,直接使用 brew 单独安装 http://openresty.org/cn/installation.html brew updatebrew install pcre openssl 安装成功后使用 list 查询安装路径 brew list pcre openssl/usr/local/Cellar/pcre/8.41/bin/pcre-config/usr/local/Cellar/pcre/8.41/bin/...
|RESTY_APK_REPO_URL | "http://openresty.org/package/alpine/v${RESTY_IMAGE_TAG}/main" | The URL of the APK repository for `openresty` package. | |RESTY_APK_VERSION | "=1.19.3.1-r0" | The suffix to add to the apk instaalpackage name: `openresty${RESTY_APK_VERSION`}. | ...
git clone https://github.com/replay/ngx_http_consistent_hash.git 后边安装openresty时有参数指向上述工程的本地地址。 (2).openrestry低版本编译命令 低版本编译时需要手动指定很多组件(使用高版本不用指定下述这么多): ./configure --prefix=/app/3rd/nginx/openresty --with-cc-opt=-O2 --add-module=bui...