My nginx root is /usr/share/nginx/html/ and flood is at /root/flood/. But the reverse proxy searches for flood at nginx root.
I followed the wiki for the location block. And changed the base uri in flood's config.
But I get a blank page, but the title bar says "Flood"
Here is the nginx error log
2017/10/26 16:41:43 [error] 3585#0: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 49.206.123.228, server: _, request: "GET /t HTTP/1.1", upstream: "http://127.0.0.1:3000/t", host: "139.59.46.93"
2017/10/26 16:41:43 [error] 3585#0: *5 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 49.206.123.228, server: _, request: "GET /t HTTP/1.1", upstream: "http://127.0.0.1:3000/t", host: "139.59.46.93"
2017/10/26 16:41:43 [error] 3585#0: *5 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 49.206.123.228, server: _, request: "GET /favicon.ico HTTP/1.1", host: "139.59.46.93", referrer: "http://139.59.46.93/t"
2017/10/26 16:41:43 [error] 3585#0: *5 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.123.228, server: _, request: "GET /favicon.ico HTTP/1.1", host: "139.59.46.93", referrer: "http://139.59.46.93/t"
2017/10/26 16:41:45 [error] 3585#0: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 49.206.123.228, server: _, request: "GET /t/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "139.59.46.93"
2017/10/26 16:41:45 [error] 3585#0: *5 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 49.206.123.228, server: _, request: "GET /t/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "139.59.46.93"
##### Ignore above errors. Forgot to use public IP
2017/10/26 16:43:45 [error] 3620#0: *1 open() "/usr/share/nginx/html/static/css/main.749f8f8f.css" failed (2: No such file or directory), client: 49.206.123.228, server: _, request: "GET /static/css/main.749f8f8f.css HTTP/1.1", host: "139.59.46.93", referrer: "http://139.59.46.93/t/"
2017/10/26 16:43:45 [error] 3620#0: *1 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.123.228, server: _, request: "GET /static/css/main.749f8f8f.css HTTP/1.1", host: "139.59.46.93", referrer: "http://139.59.46.93/t/"
2017/10/26 16:43:45 [error] 3620#0: *1 open() "/usr/share/nginx/html/static/js/main.5957a012.js" failed (2: No such file or directory), client: 49.206.123.228, server: _, request: "GET /static/js/main.5957a012.js HTTP/1.1", host: "139.59.46.93", referrer: "http://139.59.46.93/t/"
2017/10/26 16:43:45 [error] 3620#0: *1 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.123.228, server: _, request: "GET /static/js/main.5957a012.js HTTP/1.1", host: "139.59.46.93", referrer: "http://139.59.46.93/t/"
2017/10/26 16:43:48 [error] 3620#0: *1 open() "/usr/share/nginx/html/static/css/main.749f8f8f.css" failed (2: No such file or directory), client: 49.206.123.228, server: _, request: "GET /static/css/main.749f8f8f.css HTTP/1.1", host: "139.59.46.93", referrer: "http://139.59.46.93/t/"
2017/10/26 16:43:48 [error] 3620#0: *1 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.123.228, server: _, request: "GET /static/css/main.749f8f8f.css HTTP/1.1", host: "139.59.46.93", referrer: "http://139.59.46.93/t/"
2017/10/26 16:43:48 [error] 3620#0: *3 open() "/usr/share/nginx/html/static/js/main.5957a012.js" failed (2: No such file or directory), client: 49.206.123.228, server: _, request: "GET /static/js/main.5957a012.js HTTP/1.1", host: "139.59.46.93", referrer: "http://139.59.46.93/t/"
2017/10/26 16:43:48 [error] 3620#0: *3 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.123.228, server: _, request: "GET /static/js/main.5957a012.js HTTP/1.1", host: "139.59.46.93", referrer: "http://139.59.46.93/t/"
2017/10/26 16:43:50 [error] 3620#0: *3 open() "/usr/share/nginx/html/static/css/main.749f8f8f.css" failed (2: No such file or directory), client: 49.206.123.228, server: _, request: "GET /static/css/main.749f8f8f.css HTTP/1.1", host: "139.59.46.93", referrer: "http://139.59.46.93/t/"
2017/10/26 16:43:50 [error] 3620#0: *3 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.123.228, server: _, request: "GET /static/css/main.749f8f8f.css HTTP/1.1", host: "139.59.46.93", referrer: "http://139.59.46.93/t/"
2017/10/26 16:43:50 [error] 3620#0: *1 open() "/usr/share/nginx/html/static/js/main.5957a012.js" failed (2: No such file or directory), client: 49.206.123.228, server: _, request: "GET /static/js/main.5957a012.js HTTP/1.1", host: "139.59.46.93", referrer: "http://139.59.46.93/t/"
2017/10/26 16:43:50 [error] 3620#0: *1 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.123.228, server: _, request: "GET /static/js/main.5957a012.js HTTP/1.1", host: "139.59.46.93", referrer: "http://139.59.46.93/t/"
2017/10/26 16:43:50 [error] 3620#0: *1 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 49.206.123.228, server: _, request: "GET /favicon.ico HTTP/1.1", host: "139.59.46.93", referrer: "http://139.59.46.93/t/"
2017/10/26 16:43:50 [error] 3620#0: *1 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.123.228, server: _, request: "GET /favicon.ico HTTP/1.1", host: "139.59.46.93", referrer: "http://139.59.46.93/t/"
Working fine with Nginx reverse proxy here.
Flood
baseURI: '/',
Nginx
location / {
proxy_pass http://hodor:3000/;
}
Very standard settings worked fine basically.
Well, your conf is just proxying from http://hodor:3000/ to http://hodor/ if I'm not wrong. What I want is it to proxy to http://hodor/flood/ where the flood folder is outside the nginx root.
Ah right, my proxy is actually running in a separate LXC. Not sure what's up then...
UPDATE
Used the following config to atleast stop showing a blank page :
location /flood/ {
rewrite ^/flood/(.*) /$1 break;
proxy_pass http://139.59.81.38:3000/;
sub_filter 'action="/' 'action="/flood/';
sub_filter 'href="/' 'href="/flood/';
sub_filter 'src="/' 'src="/flood/';
sub_filter_once off;
}
Note that it shows the login page right away. Even though I did not create an account in Flood yet.
Here is the nginx error log after the edit.
2017/10/27 14:38:47 [error] 3426#0: *4 open() "/usr/share/nginx/html/auth/verify" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /auth/verify?1509115127151 HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/"
2017/10/27 14:38:47 [error] 3426#0: *4 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /auth/verify?1509115127151 HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/"
2017/10/27 14:38:47 [error] 3426#0: *1 open() "/usr/share/nginx/html/static/media/Roboto-regular.f84cb1bf.woff2" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /static/media/Roboto-regular.f84cb1bf.woff2 HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/static/css/main.749f8f8f.css"
2017/10/27 14:38:47 [error] 3426#0: *1 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /static/media/Roboto-regular.f84cb1bf.woff2 HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/static/css/main.749f8f8f.css"
2017/10/27 14:38:47 [error] 3426#0: *4 open() "/usr/share/nginx/html/static/media/Roboto-700.3b38c16e.woff2" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /static/media/Roboto-700.3b38c16e.woff2 HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/static/css/main.749f8f8f.css"
2017/10/27 14:38:47 [error] 3426#0: *4 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /static/media/Roboto-700.3b38c16e.woff2 HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/static/css/main.749f8f8f.css"
2017/10/27 14:38:47 [error] 3426#0: *1 open() "/usr/share/nginx/html/static/media/Roboto-500.1afbee5a.woff2" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /static/media/Roboto-500.1afbee5a.woff2 HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/static/css/main.749f8f8f.css"
2017/10/27 14:38:47 [error] 3426#0: *1 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /static/media/Roboto-500.1afbee5a.woff2 HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/static/css/main.749f8f8f.css"
2017/10/27 14:38:47 [error] 3426#0: *1 open() "/usr/share/nginx/html/api/activity-stream" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /api/activity-stream?historySnapshot=fiveMin HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/"
2017/10/27 14:38:47 [error] 3426#0: *1 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /api/activity-stream?historySnapshot=fiveMin HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/"
2017/10/27 14:38:47 [error] 3426#0: *1 open() "/usr/share/nginx/html/static/media/Roboto-regular.f94d5e51.woff" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /static/media/Roboto-regular.f94d5e51.woff HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/static/css/main.749f8f8f.css"
2017/10/27 14:38:47 [error] 3426#0: *1 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /static/media/Roboto-regular.f94d5e51.woff HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/static/css/main.749f8f8f.css"
2017/10/27 14:38:47 [error] 3426#0: *4 open() "/usr/share/nginx/html/static/media/Roboto-700.43183bee.woff" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /static/media/Roboto-700.43183bee.woff HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/static/css/main.749f8f8f.css"
2017/10/27 14:38:47 [error] 3426#0: *4 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /static/media/Roboto-700.43183bee.woff HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/static/css/main.749f8f8f.css"
2017/10/27 14:38:47 [error] 3426#0: *6 open() "/usr/share/nginx/html/static/media/Roboto-500.0f3b7101.woff" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /static/media/Roboto-500.0f3b7101.woff HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/static/css/main.749f8f8f.css"
2017/10/27 14:38:47 [error] 3426#0: *6 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /static/media/Roboto-500.0f3b7101.woff HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/static/css/main.749f8f8f.css"
2017/10/27 14:38:47 [error] 3426#0: *6 open() "/usr/share/nginx/html/static/media/Roboto-regular.38861cba.ttf" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /static/media/Roboto-regular.38861cba.ttf HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/static/css/main.749f8f8f.css"
2017/10/27 14:38:47 [error] 3426#0: *6 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /static/media/Roboto-regular.38861cba.ttf HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/static/css/main.749f8f8f.css"
2017/10/27 14:38:47 [error] 3426#0: *4 open() "/usr/share/nginx/html/static/media/Roboto-700.ad97d029.ttf" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /static/media/Roboto-700.ad97d029.ttf HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/static/css/main.749f8f8f.css"
2017/10/27 14:38:47 [error] 3426#0: *4 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /static/media/Roboto-700.ad97d029.ttf HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/static/css/main.749f8f8f.css"
2017/10/27 14:38:47 [error] 3426#0: *1 open() "/usr/share/nginx/html/static/media/Roboto-500.88f29ea5.ttf" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /static/media/Roboto-500.88f29ea5.ttf HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/static/css/main.749f8f8f.css"
2017/10/27 14:38:47 [error] 3426#0: *1 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /static/media/Roboto-500.88f29ea5.ttf HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/static/css/main.749f8f8f.css"
2017/10/27 14:40:31 [error] 3426#0: *8 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /favicon.ico HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/login"
2017/10/27 14:40:31 [error] 3426#0: *8 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 49.206.124.118, server: _, request: "GET /favicon.ico HTTP/1.1", host: "139.59.76.232", referrer: "http://139.59.76.232/flood/login"
Someone please post a working .conf for proxying to http://IP/flood where the flood folder sits at /root/ i.e /root/flood. Using subdomain proxying or moving the flood folder into the nginx root is unfortunately not an option for me.
Please read the nginx docs, or ask for help in an nginx-related forum.
Can you tell me where the flood/ folder has to sit for the nginx location block you have put up in the wiki?
same problem. Other proxy's work fine tho.
@veganexe Did you find a solution?
@veganexe
upstream flood { server 127.0.0.1:3000; }
# snip
server {
listen 80;
server_name _
location / {
return 200 "<h1>Foobar</h1>";
add_header Content-Type text/html;
}
location /flood/ { # slash here
proxy_pass http://flood/; # and slash here
proxy_max_temp_file_size 0; # for downloads > 1.1G
}
}
With baseURI set to /flood.
@dcousens Thanks for the response.
I did what what you suggested, but I still only have a blank page...
Tried it with floodServerHost: '0.0.0.0' and '127.0.0.1. Not sure if it would make any difference.
I also tried a other method suggested by @jfurrow rewrite ^/flood/(.*) /$1 break; in location /flood/ but no luck.