stellar / go

Stellar's public monorepo of go code
https://stellar.org/developers
Apache License 2.0
1.29k stars 502 forks source link

Update Horizon admin guide with nginx setup instructions #242

Open bartekn opened 6 years ago

bartekn commented 6 years ago

Nginx has to be configured correctly for event source streams: https://serverfault.com/a/801629

khelle commented 6 years ago

What exactly needs to be configured? I tried doing proxy via Nginx but without success, this is my nginx config file I tried according to the link @bartekn posted.

server {
  listen 14040 ssl default_server;
  server_name _;
  ssl_certificate /etc/nginx/ssl/nginx.crt;
  ssl_certificate_key /etc/nginx/ssl/nginx.key;
  underscores_in_headers on;

  location / {
    auth_basic "Restricted Content";
    auth_basic_user_file /etc/nginx/.htpasswd;
    proxy_http_version 1.1;
    proxy_read_timeout 300;
    proxy_set_header  Host $host;
    proxy_set_header  Connection "";
    proxy_set_header  Cache-Control no-cache;
    proxy_set_header  Transfer-Encoding chunked;
    proxy_set_header  X-Real-IP $remote_addr;
    proxy_set_header  X-Forwarded-Proto https;
    proxy_set_header  X-Forwarded-For $remote_addr;
    proxy_set_header  X-Forwarded-Host $remote_addr;
    proxy_set_header  X-Accel-Buffering no;
    proxy_pass        https://localhost:15040;
    proxy_pass_request_headers on;
  }
}

I am getting ECONNREFUSED regardless If I set Connection, Cache-Control or X-Accel-Buffering. The only option that seems to matter is Transfer-Encoding - if I set it to chunked I get TIMEOUT instead of CONN REFUSED. When I try to access horizon directly (using port 15040 instead of proxy's 14040) everything works fine.

bartekn commented 6 years ago

Please use our StackExchange for questions.

howardtw commented 5 years ago

What's the status of this issue @bartekn ?

bartekn commented 5 years ago

@howardtw not done. We need to explain this in Horizon admin guide.

ChrisRut commented 4 years ago

I had to add proxy_buffering off; in order for it to play nice.