NGINX-proxy runs but web-browser shows server refusal (VPS Hostinger) #376
Unanswered
scorpion870
asked this question in
Q&A
Replies: 1 comment
-
Hello @scorpion870 thanks for you message. I read your message but still did not have the time to test it. I am not using rootless right due to the structure we have but if you still need help on that or found the solution please give some feedback here and we can arrange to figure it out a working solution. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, i have been trying to learn rootless containers and server automation from your youtube tutorial, but the Nginx proxy just doesn't seem to run! huh.. After 14 VPS OS re-installs in last 7 days (4 after following your guides also) i can conclude the problems step-wise as below, please have a quick look:
VPS Provider: Hostinger
OS : Ubuntu 20.04.5 LTS
-- Reference Tutorial: Configure your VPS or Server with Server Automation scripts!
-- https://www.youtube.com/watch?v=eiTivLeIkm0
MY STEP WISE REPORT:
-- apt update && apt upgrade
-- install fail2ban (and configure) -- Ok
-- add 2nd user with sudo
-- edit sshd, restrict root ssh, and restart sshd
-- check login with 2nd user, logout with both root n new user, re-log in with new user
-- Try cloning easy server script using git command
-- Needed to install Git command first! ok!
-- user14@wpngnm:
$ git clone https://github.com/evertramos/easy-server.git -- (as non root) -- OK DONE/easy-server/aliases$ ./load.sh -- (as non root, aliases added, relogin) -- OK DONE-- user14@wpngnm:
-- user14@wpngnm:
/easy-server/install/docker$ ./install-docker.sh -- (as non root, docker installed, and running after relogin, although script has docker compose as sudo, fine)/easy-server/install/nginx-proxy$ sdl-- LOG OUT, MADE A SERVER SNAPSHOT -- (because i have failed after this step in NGINX proxy docker many times)**
-- ssh as new user14, check again docker status, running -- ok
-- PREPARING for NGINX proxy script install
-- a) STOP APACHE2 -- sudo systemctl start apache2
-- (unfortunately, i learnt after 3 server install, understood port binding error, then confirmed in your docs)
-- b) Added permission to write in /var/logs -- (using sudo chmod o+w, or else NGINX proxy install script shows log error)
-- c) CHECK THE NETWORK INTERFACE*** -- (using 'ip a' command, in 3 server reinstalls, got IP error, realized, my VPS uses venet0 instead of eth0 etc as written in your script, so i added my Network interface, please add it to your script)
-- d) Vim EDIT NGINX install-proxy.sh -- (added email, added correct network interface)
-- Run install script NGINX -- ( ./install-proxy.sh -- Installed, cool) -- OK DONE
-- check docker ps -- yes running, and also using alias -- sdl, -- OK DONE
user14@wpngnm:
IMAGE STATUS NAMES
nginxproxy/docker-gen:0.9 Up 2 minutes docker-gen-auto
nginx:stable-alpine Up 2 minutes proxy-web-auto
nginxproxy/acme-companion:2.2 Up 2 minutes letsencrypt-auto
-- Check VPS ip in browser -- PROBLEM!! : This site can’t be reached xxx.xxx.XXX.xxx (My VPS ip) refused to connect.
-- Stop NGINX docker, and start apache2 again
-- Putting my site name in brave/mozilla, or server IP, i see Apache2 page (so yes, Domain are pointing to VPS correctly, to make double sure used : "dig A +short (DOMAIN NAME)" from laptop, they are pointing to my VPS IP)
-- Again stop Apache2, and start NGINX docker, check in browser
-- Again, site cannot be reached, server refused to connect
-- Troubleshoot Ports: Then i suspected maybe some unknown firewall rule is blocking? So here is the status:
--- "sudo lsof -i -P -n | grep LISTEN"
systemd-r 118 systemd-resolve 13u IPv4 877605128 0t0 TCP 127.0.0.53:53 (LISTEN)
sshd 310 root 3u IPv4 877597424 0t0 TCP *:22 (LISTEN)
sshd 310 root 4u IPv6 877611731 0t0 TCP *:22 (LISTEN)
exim4 599 Debian-exim 3u IPv4 877602314 0t0 TCP 127.0.0.1:25 (LISTEN)
exim4 599 Debian-exim 4u IPv6 877602315 0t0 TCP [::1]:25 (LISTEN)
docker-pr 2385 root 4u IPv4 880126528 0t0 TCP 127.0.0.1:443 (LISTEN)
docker-pr 2398 root 4u IPv4 880153986 0t0 TCP 127.0.0.1:80 (LISTEN)
-- So yes, ports are running and listening, docker is managing 80 and 443
-- Trouble shoot NETWORK INTERFACE -- using ip a command, there is only 1 Interface DOWN, docker interface:
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:7f:d8:e0:5c brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
(And Please NOTE : this was down, even before installing NGINX proxy, i noted this when copying Network interface venet0)
I think this maybe the problem? I tried to turn this on, with:
-- Try to turn on Docker0 network interface: "sudo ip link set docker0 up"
BUt nope, with all commands, its status always remains down... and my trouble shooting skills are over. x-x
-- Also note : if i reboot server, apache is on by default, i need to manually turn it off, manually turn on NGINX docker (proxy-web-auto), but again in my web browser, vps ip shows no effect (and then if i stop nginx docker, restart apache, all my 3 websites or server ip in web browser shows apache2 welcome page)
-- I even tried to allow sudo in the .env file in /home/shambho15/server/proxy/compose , but no use
(Although, I DONT Want to run docker as root, my goal is to run it rootless, for security)
(still i suspect, maybe its some permission issue? NGINX proxy docker installed as non root? but apache is default? Do i need to add some permission somewhere else? I don't know..)
-- I am not sure WHAT the problem is here... Why doesnt my Server respond with NGINX proxy docker?
Can you PLEASE help me? i have been at it for almost 1 week (Thankfully reached your link in last 3 days, its strange, another person using your script has more views and likes on youtube than you, you deserve more)
-- If you can point me to any solution, it will be great help. Thanks in advance, regards.
Beta Was this translation helpful? Give feedback.
All reactions