You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -367,6 +368,44 @@ In order for this parameter to work, it is usually necessary to run nginx worker
367
368
368
369
NOTE: If using `set $<nginx variable>` and `proxy_connect_bind $<nginx variable>` together, you should use `proxy_connect_rewrite.patch` instead, see [Install](#install) for more details.
The `curl` command test case with above config is as following:
390
+
391
+
```
392
+
$ curl https://github.com -sv -x localhost:3128
393
+
* Connected to localhost (127.0.0.1) port 3128 (#0)
394
+
* allocate connect buffer!
395
+
* Establish HTTP proxy tunnel to github.com:443
396
+
> CONNECT github.com:443 HTTP/1.1
397
+
> Host: github.com:443
398
+
> User-Agent: curl/7.64.1
399
+
> Proxy-Connection: Keep-Alive
400
+
>
401
+
< HTTP/1.1 200 Connection Established --.
402
+
< Proxy-agent: nginx | custom CONNECT response
403
+
< X-Proxy-Connected-Addr: 13.229.188.59:443 --'
404
+
...
405
+
406
+
```
407
+
408
+
370
409
Variables
371
410
=========
372
411
@@ -465,6 +504,8 @@ rewrite_by_lua '
465
504
';
466
505
```
467
506
507
+
Also note that `set` or `rewrite_by_lua*` directive is run during the REWRITE phase, which is ahead of dns resolving phase. It cannot get right value of some variables, for example, `$connect_addr` value is `nil`. In such case, you should use [`proxy_connect_response` directive](#proxy_connect_response) instead.
0 commit comments