# Reverse proxy for Logstash - is this even possible now?

**URL:** <https://discuss.elastic.co/t/reverse-proxy-for-logstash-is-this-even-possible-now/147550>\
**Category:** Logstash\
**Created:** [September 6, 2018, 10:22am UTC](https://discuss.elastic.co/t/reverse-proxy-for-logstash-is-this-even-possible-now/147550 "2018-09-06T10:22:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pastechecker](https://avatars.discourse-cdn.com/v4/letter/p/0ea827/32.png) [@pastechecker](https://discuss.elastic.co/u/pastechecker)\
**Post date:** [September 6, 2018, 10:22am UTC](https://discuss.elastic.co/t/reverse-proxy-for-logstash-is-this-even-possible-now/147550/1 "2018-09-06T10:22:50Z")

</div>

Hello,  
I have Logstash 6.4 installed on Debian 9.5.

Recently I had to move Logstash to one zone where the only option to get out to the internet is over reverse proxy. I have multiple http\_pollers in my Logstash configuration, including tweeter plugin, but all of it does not operate because of the connectivity problems.

Config in /etc/profile

> MY\_PROXY\_URL="[http://proxy.myproxy.net:8080](http://proxy.myproxy.net:8080)"  
> HTTP\_PROXY=$MY\_PROXY\_URL  
> HTTPS\_PROXY=$MY\_PROXY\_URL  
> FTP\_PROXY=$MY\_PROXY\_URL  
> http\_proxy=$MY\_PROXY\_URL  
> https\_proxy=$MY\_PROXY\_URL  
> ftp\_proxy=$MY\_PROXY\_URL  
> export HTTP\_PROXY HTTPS\_PROXY FTP\_PROXY http\_proxy https\_proxy ftp\_proxy  
> export NODE\_EXTRA\_CA\_CERTS="/etc/ca-certificates/proxy.myproxy.net.crt"

I have specified in the file: /etc/logstash/jvm.options

> SET LS\_JAVA\_OPTS=-Dhttp.proxyHost=[http://proxy.myproxy.net](http://proxy.myproxy.net) -Dhttp.proxyPort=8080

But it seems that Logstash is not using the proxy.

> [2018-09-06T12:13:50,054][WARN][logstash.inputs.twitter] Twitter client error {:message=\>"Connection refused - connect(2) for "199.16.156.20" port 443", :exception=\>"Errno::ECONNREFUSED", :backtrace=\>["org/jruby/ext/socket/RubyTCPSocket.java:134:in `initialize'", "org/jruby/RubyIO.java:875:in `new'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-twitter-3.0.8/lib/logstash/inputs/twitter/patches.rb:26:in `stream'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-twitter-3.0.8/lib/logstash/inputs/twitter/patches.rb:58:in `request'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/twitter-5.15.0/lib/twitter/streaming/client.rb:37:in `filter'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-twitter-3.0.8/lib/logstash/inputs/twitter.rb:138:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:408:in `inputworker'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:402:in `block in start\_input'"], :options=\>nil}

Is this even possible to have that configuration working at the current stage of Logstash where a reverse proxy is a must?  
If yes, what is the current recommendation about configuring the Logstash behind a reverse proxy?

Thanks!

---

<div class="post-metadata">

**Author:** ![pastechecker](https://avatars.discourse-cdn.com/v4/letter/p/0ea827/32.png) [@pastechecker](https://discuss.elastic.co/u/pastechecker)\
**Post date:** [September 6, 2018, 12:17pm UTC](https://discuss.elastic.co/t/reverse-proxy-for-logstash-is-this-even-possible-now/147550/2 "2018-09-06T12:17:33Z")

</div>

Solved the problem partially by specifying in the

http\_poller configuration

> proxy =\> { host =\> "[proxy.myproxy.net](http://proxy.myproxy.net)" port =\> 8080 scheme =\> 'http' }

and for twitter:

> ```
> use_proxy => true
> proxy_address => "172.1.3.10"
> proxy_port => "8080"
> 
> ```

However, I am getting: Twitter::Error::GatewayTimeout"  
Is there any setting that I can increase the timeout?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 4, 2018, 12:17pm UTC](https://discuss.elastic.co/t/reverse-proxy-for-logstash-is-this-even-possible-now/147550/3 "2018-10-04T12:17:38Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
