Flood-UI / flood

A web UI for rTorrent, qBittorrent and Transmission with a Node.js backend and React frontend. Migrate to v4: https://github.com/jesec/flood/wiki/Migrate-from-older-versions-of-Flood.

Home Page:https://flood.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trouble running Flood behind Nginx

wheelerlaw opened this issue · comments

Type: Question

Question

I am having trouble getting Flood running behind nginx. I have followed this wiki page, but it appears that all of the requests are just passing the index.html back to my browser.

My nginx config has a server block that looks like this:

server {
    server_name <my hostname>;
    location /flood {
        proxy_pass http://localhost:8080;
    }

    listen 80;
}

I set the baseUri variable in the config.docker.js before running the build through Docker compose. When I navigate to the nginx instance, it loads the index.html but any other requests to the other static resources fail because those requests are also just returning the index.html for some reason. Here is the Flood log:

Successfully built cf373a4ddd8a
Successfully tagged seedbox_flood:latest
Creating network "seedbox_default" with the default driver
Creating seedbox_flood_1 ... done
Attaching to seedbox_flood_1
flood_1  | 
flood_1  | > flood@1.0.0 start /usr/src/app
flood_1  | > node --use_strict server/bin/start.js
flood_1  | 
flood_1  | Flood server starting on http://undefined:3000.
flood_1  | 
flood_1  | GET /flood 200 11.224 ms - 544
flood_1  | GET /flood/static/css/main.3128781c.css 200 1.937 ms - 544
flood_1  | GET /flood/static/js/main.33ac4144.js 200 1.221 ms - 544
flood_1  | GET /flood/favicon.ico 200 1.183 ms - 544

Notice how all of the responses are the exact same size.

When I try to curl one of the static resources, I am just getting the index.html back:

$ curl <my hostname>/flood/static/js/main.33ac4144.js
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/flood/manifest.json"><link rel="shortcut icon" href="/flood/favicon.ico"><title>Flood</title><link href="/flood/static/css/main.3128781c.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="app"></div><script src="/flood/static/js/main.33ac4144.js"></script></body></html>

I should note that in my docker-compose.yml, I am forwarding port 8080 to port 3000, so that's why they don't line up.

Nginx

- location /flood {
+ location /flood/ {

config.js

-baseURI: '/flood/'
+baseURI: '/flood'

Yeah, still no dice. Please re-open.

This is a problem with your config, not Flood.

I am running it exactly as the wiki page in this repo points out.

I should also note that the Flood docker config is unchanged, with the exception of changing the baseUri. Flood seems to be aware it's receiving the correct requests (with the proper paths in the URI), but for some reason keeps responding to them with the index.html.

So it looks like this is only a problem is the baseUri is set to anything other than /. I just tried out Flood behind nginx without a baseUri set in flood and the location block set in nginx to just /. This seems most definitely like a bug in Flood.

It's possible there's a bug with the Docker image, for sure. Apologies if so — I don't use it. You can open a new issue for that if you suspect that's the case.

I do run Flood behind a reverse proxy, and use a baseUri that is not /, and can confirm it works as expected on the latest master.

It's possible there's a bug with the Docker image, for sure. Apologies if so — I don't use it. You can open a new issue for that if you suspect that's the case.

I didn't know what to suspect, so I opened up this question in search of help. But given how quickly this issue was closed, and the certainly less than helpful responses, it would appear that seeking help is beyond what I should expect from a channel that's often used to seek help.

I do run Flood behind a reverse proxy, and use a baseUri that is not /, and can confirm it works as expected on the latest master.

That's nice. I'm using nginx's recommended reverse proxy configuration as provided in their manual, and its quite clear that Flood isn't operating correctly, since it keeps returning the index.html (despite it receiving the correct URI, as was shown in the logs I provided) So you must be using a custom nginx configuration to account for this. But it must be some tight-lipped secret since you were so confident that it was an issue with my configuration but refused to say a word more.

I didn't know what to suspect, so I opened up this question in search of help. But given how quickly this issue was closed, and the certainly less than helpful responses, it would appear that seeking help is beyond what I should expect from a channel that's often used to seek help.

You didn't ask a question, you asked for personal support. The github issue tracker is not teh place for that. Please go to the discord community server and ask in the appropriate channel. Else remember this is a project maintained for free by people on their free time. You can demand support for a paid product where you paid a guarantee and support. Which is not the case here.

Github issues are not the canonical place to ask for help. Please take @noraj's suggestion and ask for help in the Discord server. No hard feelings here — I understand this isn't clear to many users (see literally every open source Github repo, people frequently open issues asking for help).

In this repo, nginx config help is requested all the time, which admittedly suggests Flood's documentation in this regard isn't sufficient. To that effort, I've attempted to provide the simplest possible nginx configuration example, and ensure that it works. Logistically, I can't debug everybody's nginx configuration issues — the best I can do is provide simple examples.

There's no tight-lipped secret with regard to the nginx config. It's publicly available in the wiki. For full transparency, here's the nginx configuration I'm using right now (with irrelevant details redacted or removed):

server {
        server_name <server_name>;

        location /flood/ {
                proxy_pass https://<server_ip>:<port>/;
                proxy_ssl_certificate <path_to_proxied_server_ssl_cert>;
                proxy_ssl_certificate_key <path_to_proxied_server_ssl_cert_key>;
                proxy_ssl_trusted_certificate <path_to_proxied_server_ssl_cert>;
                proxy_ssl_session_reuse on;
        }

        listen [::]:443 ssl ipv6only=on;
        listen 443 ssl;
        ssl_certificate <path_to_nginx_server_ssl_cert>;
        ssl_certificate_key <path_to_nginx_server_ssl_cert_key>;
        include <path_to_letsencrypt_nginx_config>;
        ssl_dhparam <path_to_letsencrypt_ssl_dhparam>;
        client_max_body_size <some_number_of_megabytes>M;
}

I'm sorry you're having such a rough time with this. I'm going to unlock this, because I don't feel right about silencing you, but please reach out for help in the Discord server.

@wheelerlaw Did you rebuild the static assets after changing the baseURI? Apparently that doesn't happen automatically in the Docker image, see this comment #448 (comment)

@jfurrow I did.
Thanks for the help, that template config worked beautifully.