lua-nginx-module icon indicating copy to clipboard operation
lua-nginx-module copied to clipboard

feature: add FFI function for balancer.disable_ssl

Open vislee opened this issue 4 years ago • 4 comments

I hereby granted the copyright of the changes in this pull request to the authors of this lua-nginx-module project.

Dynamically downgrade to HTTP to upstream based on SNI.

    server {
        listen          1984;
        server_name    *.test.com;

        location / {
            proxy_pass https://backend;
        }
    }
    upstream backend {
        server 127.0.0.1;
        balancer_by_lua_block {
             local b = require "ngx.balancer"
             if ngx.ctx.host == 'a.test.com' then
                 b.disable_ssl()
                 b.set_current_peer("127.0.0.11", 80)
             end
             b.set_current_peer("127.0.0.11", 443)
        }
    }

vislee avatar Apr 10 '20 02:04 vislee

@vislee Thanks for your PR, could you help to add some test cases?

rainingmaster avatar Apr 10 '20 10:04 rainingmaster

@vislee Thanks for your PR, could you help to add some test cases?

@rainingmaster The test case in lua-resty-core repository, ngx_http_lua_ffi_balancer_get_last_failure is also absent, I don't know how to add it. :(

vislee avatar Apr 11 '20 12:04 vislee

@vislee Thanks for your PR, could you help to add some test cases?

@rainingmaster The test case in lua-resty-core repository, ngx_http_lua_ffi_balancer_get_last_failure is also absent, I don't know how to add it. :(

OK, that is fair, we can discuss in the related PR

rainingmaster avatar Apr 12 '20 04:04 rainingmaster

This pull request is now in conflict :(

mergify[bot] avatar Jul 30 '20 11:07 mergify[bot]