Created
February 24, 2016 04:09
-
-
Save lamanotrama/192f06ac9a2945ab261d to your computer and use it in GitHub Desktop.
なぜかリクエストの度にlookupしてくれない。streamの設定
This file contains 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
stream { | |
upstream deis { | |
server deis-elb-01.aya.staging:2222; | |
} | |
server { | |
listen 2222; | |
# resolve ELB's hostname to IP | |
mruby_stream_code ' | |
host = "deis-elb-01.aya.staging" | |
port = "2222" | |
c = Nginx::Stream::Connection.new "deis" | |
c.upstream_server = Addrinfo.tcp("#{host}", nil).ip_address << ":#{port}" | |
'; | |
proxy_pass deis; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment