can not proxy from nginx
See original GitHub issueIssue details
I want to proxy localhost:3001 from nginx, but it doesn't work.
(sorry, I’m not good for English, I’m Chinese)
Please specify which version of Browsersync, node and npm you’re running
- Browsersync [ 2.12.8 ]
- Node [ 5.10.1 ]
- Npm [ 3.8.3 ]
Affected platforms
- linux
- windows
- OS X
Browsersync use-case
- API
- Gulp
- Grunt
- Nginx
for all other use-cases, (gulp, grunt etc), please show us exactly how you’re using Browsersync
- my plan for the development environment
firefox <------> nginx (rewrite path, proxy to api) <---(proxy)---> browser-sync (gulp auto build website files)
- browser-sync
browserSync.init({
socket: {
path: '/browser-sync/socket.io',
clientPath: '/browser-sync',
namespace: '/browser-sync',
domain: 'testbs.org'
},
server: 'public',
open: true
});
- nginx
server {
listen 80;
server_name testbs.org;
......
# BrowserSync
location / {
proxy_pass http://localhost:3000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
# BrowserSync websocket
location /browser-sync/socket.io/ {
proxy_pass http://localhost:3001/browser-sync/socket.io/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
......
}
- Browser Console
GET http://testbs.org/browser-sync/socket.io/?EIO=3&transport=polling&t=LJ9VN7W
504 Gateway Time-out 1m browser...12.8.js (line 1)
GET http://testbs.org/browser-sync/socket.io/?EIO=3&transport=polling&t=LJ9VSOA
504 Gateway Time-out 1m browser...12.8.js (line 1)
GET http://testbs.org/browser-sync/socket.io/?EIO=3&transport=polling&t=LJ9VY2g
504 Gateway Time-out 1m browser...12.8.js (line 1)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:9
Top Results From Across the Web
proxy - nginx simple proxy_pass to localhost not working
If I ssh to the machine and run curl http://127.0.0.1:3000/ , I get the desired result (and eventually I ran that server on...
Read more >Nginx/proxy not working properly - Server Fault
the problem is that Nginx is giving bad gateway for all proxied requests and timeout for the direct ip access. proxy conf :...
Read more >NGINX Reverse Proxy Configuration and Troubleshooting
In normal reverse proxy configuration, NGINX act as a TLS terminator, it will not pass TLS connection to original server. In some scenario...
Read more >NGINX Reverse Proxy | NGINX Plus - NGINX Documentation
Configure NGINX as a reverse proxy for HTTP and other protocols, with support for modifying request headers and fine-tuned buffering of responses.
Read more >Why is reverse proxy is not working with nginx? - DigitalOcean
I have spun up a Fedora box, and am running a golang server at port 8080. I am trying to setup nginx reverse...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@adambuczek my issue has been resolved by myself😀 let me show you about my configuration:
and now, i can do refresh by the
test.local.dev
, didn’t use thelocalhost
😃@realmx yes that describes how BrowserSync works.
However, it does not explain why when I run it without nginx it is about 5x faster then if Nginx is implemented. I would expect it to be negligibly slower with nginx, but not 5x slower. It’s IMHO, it’s unusable due to this length of delay.