PX4 / flight_review

web application for flight log analysis & review
https://logs.px4.io/
BSD 3-Clause "New" or "Revised" License
200 stars 193 forks source link

using nginx as proxy server #183

Open lijieamd opened 4 years ago

lijieamd commented 4 years ago

I already have a web on my server, so i use nginx to proxy http request for flight_review. everything seems fine but stuck at "Loading Plots..." after ulg file uploaded. i also tried using flight_review server alone, it works fine. i don't know much about computer network, hope someone can help.

here is my nginx config and flight_review config: flight_review startup: ./serve.py --address=127.0.0.1 --port=5006 --allow-websocket-origin=* nginx config:

upstream px4_flight_review {
        server 127.0.0.1:5006;
        }

server {
        listen  80;
        server_name     px4.mysite.com;
        location / {
                proxy_pass      http://px4_flight_review;

                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                }
        }
bkueng commented 4 years ago

You need to make sure the websockets get through. You can try this: ./serve.py --address=127.0.0.1 --port=5006 --allow-websocket-origin='*' --use-xheaders

lijieamd commented 4 years ago

thanks for your reply, but use --use-xheaders option not work i believe the problem is bokeh websockets does not proxy right, i'll try some nginx config in Bokeh user guide

malavika-tii commented 2 weeks ago

Hi, what was the solution to get this working?

bkueng commented 1 week ago

This is the nginx config that should work:

    location / {
        proxy_pass http://127.0.0.1:5100;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host:$server_port;
        proxy_buffering off;
    }
malavika-tii commented 1 week ago

Hi @bkueng, also regarding the bokeh plots?

bkueng commented 1 week ago

Did you test it? Does it work without nginx proxy?