简体   繁体   中英

Nginx Reverse Proxy - Netdata - Don't display but downlaod as application/octet-stream

I recently change my VPS and reinstalled everything I need, include Netdata, Nginx. The installer works great to install Netdata. However I have some trouble to do a reverse proxy with Nginx. I already have some reverse proxy on my server and it works so the configuration should work too.

I use the official configuration of Nginx given by Netdata documentation.
https://learn.netdata.cloud/docs/agent/running-behind-nginx

So I use this configuration file:

upstream backend {
    # the Netdata server
    server 127.0.0.1:19999;
    keepalive 64;
}

server {
    # nginx listens to this
    listen 80;

    # the virtual host name of this
    server_name netdata.example.com;

    location / {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://backend;
        proxy_http_version 1.1;
        proxy_pass_request_headers on;
        proxy_set_header Connection "keep-alive";
        proxy_store off;
    }
}

But when I go in my web browser if doesn't display Netdata Dashboard but start a download of a file as application/octet-stream.

So I need some help please

Thanks

On an other virtualhost I had an mistake made by myself.

listen 80 http2;

instead of

listen 80 http2;

just use http2 for port 443 with tls/ssl

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM