cannot run node-red-docker behind nginx docker with virtual directory.

Open
#181 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
docker, nginx

Research direction

Start by reproducing the setup with the listed Ubuntu, Docker, Node-RED, and nginx versions, then inspect the nginx server configuration and the settings.js options mentioned. The issue is resolved when the Node-RED interface and its static references load correctly through the /form virtual directory.

Written by the indexing model from the issue text.

Description

What are the steps to reproduce?

install:

  1. ubuntu 20.04 desktop
  2. docker-ce 19.03.12
  3. node-red 1.0.6 (from latest docker)
  4. nginx docker
  5. launch a virtual directory named "form" and set proxy_pass to node-red container in nginx conf file.
What happens?

proxy_pass may work, but some static reference library cannot be located correctly.
image

I had tried to modify httpAdminRoot, httpNodeRoot, httpRoot, httpStatic in settings.js, seems not the correct setting item for this case.

nginx setting
upstream form {
  server form:1880;  <-- node-red container
}

server {
...
  location ~ ^/form(/?)(.*) {
    proxy_pass http://form/$2;
    proxy_http_version 1.1;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
  }

  location / {
    ...  <- run other pages here.
  }
}
Dominant language
Shell
Stars
540
Forks
434
Avg merge
24m
Merged PRs (30d)
5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from node-red/node-red-docker

All issues in node-red/node-red-docker

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.