OpenVPN 503 Service Unavailable behind http proxy - squid

I have a OpenVPN server successfully setup on a digital ocean droplet following this amazing tutorial:
https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-18-04
Then I also made a http proxy server using squid proxy on a different droplet.
When I try to connect to my VPN server, I get 503 Service Unavailable on the logs of the client.
Also when I try to curl my VPN server, still the same result:
curl -I -x myproxy.com:80 http://myvpn.com:1194 or
curl -I -x myproxy.com:80 http://myvpn.com
I turned off the ufw of my OpenVPN server, still the same results.
Where should I fix?
My OpenVPN server? My My OpenVPN server's iptables? My squid proxy conf?
Please help..

Related

Why Ngrok access encounter error 502 Bad Gateway?

I established a Ngrok tunnel on localhost, started service on port 8080, also run the command ./ngrok http 8080. All is ready, but cannot succeed:
access localhost:4040, see this following:
I use below command, it works well
ngrok http 127.0.0.1:8080 -host-header="127.0.0.1:8080"

why nginx can not redirect request to port 80 on VPS?

I run 3 servers on VPS But nginx can not connect to server that run in port 80.
nginx can connect another port.
Does anyone know?
Nginx cannot connect to the 80 port if this port is using by another application like Apache, NodeJs ... to further info can you show your nginx error log from systemctl ?

SSH forward port to local host name

I have next setup:
Local host - my work PC
Project VM - Vagrant box with project files, runned on my work PC
Remote host - remote PC, from which I need to access hosts on Project VM
Project VM setup (/etc/hosts on Local host):
192.168.100.102 host1.vm.private
192.168.100.102 sub1.host1.vm.private
192.168.100.102 sub2.host1.vm.private
"host1" subdomains resolved by application router and served by nginx (config for "host1.vm.private" on Project VM):
server {
listen 80;
server_name ~^(.+\.)?host1\.vm\.private$;
...
}
I need to make "sub(1|2|N).host1.vm.private" reachable from remote host. How this can be done?
So, i found the solution: Trouble SSH Tunneling to remote server
The main issue is that invalid HTTP header was sent and nginx cant resolve a virtual host.
Run on local PC ssh -R 8888:192.168.100.102:80 <remote_pc_credentionals>. Or, run "inversed" command with ssh -L flag on remote PC.
Add "sub1.host1.vm.private" to /etc/hosts on remote PC: 127.0.0.1 sub1.host1.vm.private
OR
Send "Host" header with each request: curl -H "Host: sub1.host1.vm.private" "http://localhost:8888/some/path"

squid proxy from localhost configs

I'm trying to give a remote machine (that I can ssh to) access to the internet through my local machine.
Currently, I've set up a squid server locally, with the intent of using a reverse tunnel a la http://ubuntuforums.org/showthread.php?t=1765935
Unfortunately, I can't seem to get the local proxy to work, on account of ignorance of how proxy-ing works.
Currently:
squid3 proxy running locally port 3128. $nmap localhost confirms: 3128/tcp open squid-http
iptables set to allow access to port 3128 only from localhost: https://serverfault.com/questions/247176/iptables-only-allow-localhost-access
squid conf unaltered.
testing locally: $export http_proxy=localhost:3128
testing locally: $lynx google.com
failure.
Any thoughts?
Try;
Add
$export https_proxy=localhost:3128
$lynx google.com
Google redirect to https

Varnish Cache - Connection Refused

I have Nginx running on 8080, while Varnish runs on port 80. I can do
wget localhost:8080
in shell and get a response, but if I run
wget localhost
I get connection refused. For reference, I'm trying to access it externally but get the same problem. Hopefully I can solve access from localhost first!
Thanks in advance!
netstat -tulnp shows you every port and service running
iptables -L shows you if port open or blocked
cheers

Resources