Skip to content

Instantly share code, notes, and snippets.

@boneskull
Created January 26, 2016 00:43
Show Gist options
  • Save boneskull/d418b7c871d2248cfeba to your computer and use it in GitHub Desktop.
Save boneskull/d418b7c871d2248cfeba to your computer and use it in GitHub Desktop.
example nginx config to reverse proxy a node-red server (websocket support)
server {
listen 80;
server_name your_server_name;
access_log /var/log/nginx/access.log;
location / {
proxy_pass http://localhost:1880;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
@garnold
Copy link

garnold commented Apr 6, 2017

Was getting a 404 on /comms until I ran across this gist. Thank you 👍

@snelweg
Copy link

snelweg commented Oct 16, 2017

thanks!
Just what I needed

@hinoobmaster
Copy link

thanks!... you are awesome !

@barisduzenli
Copy link

I configured the default sites-enabled as you shown above. The result is like in the image at the link https://ibb.co/bzfmCe .
Could you suggest anything?

@jdiegosierra
Copy link

THX!!!

@lewangdev
Copy link

Great Job

@marciomcj
Copy link

It works! Thank you!

Is it possible to pass just the UI and block the flows(admin page)?

@boneskull
Copy link
Author

@barisduzenli no idea. might be a http/https disagreement

@marciomcj which UI do you mean?

@marciomcj
Copy link

@boneskull ui=dashboard. When I go to the browser I would like to see just dashboard's tabs...

@boneskull
Copy link
Author

@marciomcj Don't know, but you should be able to reverse proxy a particular subpath. you could try changing proxy_pass http://localhost:1880; to proxy_pass http://localhost:1880/path/to/ui;

@marciomcj
Copy link

@boneskull I have tried that. Now it's working how I expected! Thank you again!

@felangga
Copy link

@marciomcj I change to localhost:1880/ui but it show me an error not found /uiui

@rtu-dataframe
Copy link

Thanks, works flawlessly!

@afeifly
Copy link

afeifly commented Nov 22, 2019

That's great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment