-
-
Save psucodervn/a00ada740f4d4d28cabc4c1f31ec36ce to your computer and use it in GitHub Desktop.
Kong auto ssl redirect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local scheme = kong.request.get_scheme() | |
if scheme == "http" then | |
local host = kong.request.get_host() | |
local query = kong.request.get_path_with_query() | |
local url = "https://" .. host ..query | |
kong.response.set_header("Location",url) | |
return kong.response.exit(302,url) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment