squid proxy from localhost configs - squid

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

Related

Set GITLAB to be accessible on LAN

After many research i have not found anything...
I install GITLAB on a CentOS VM. The CentOS ip address is 192.168.100.1.
In the file /etc/gitlab/gitlab.rb, I modified the line:
external_url 'http:192.168.100.1:1234'
I executed the command 'gitlab-ctl reconfigure' and no errors appeared.
When I use Firefox, and I can access to my Gitlab with all the Centos' interfaces:
192.168.100.1:1234
127.0.0.1:1234
It is normal because when i execute 'netstat -ntlp', I can see:
tcp 0 0.0.0.0:1234 LISTEN 22222/nginx:master
What is the problem?
I cannot access to GitLAB outside from the same Network 192.168.100.1/24.
From an other VM on the same network (192.168.100.2), i can ping '192.168.100.2'. I also make an ssh connection but if I made a:
curl 192.168.100.1:1234
The result is "Time out"
Thank,
Vincent

OpenVPN 503 Service Unavailable behind http proxy

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..

How to use ngrok with hosts file (laradock)

I am using Laradock to develop locally and so have an entry in the hosts file.
How can I get this working with ngrok?
I tried:
ngrok http -host-header=site.test 80
(https://helgesverre.com/blog/expose-local-webserver/)
but get: Failed to complete tunnel connection
(site.test works)
I got this working by running ngrok on the host machine instead of the container.

Artifactory Docker repo not listening on designated port

I'm trying to setup a Docker registry with Artifactory 5.2.1. It's a virtual repo that includes a docker-remote and docker-local (previously defined in Artifactory). I'd like to use the Port method of mapping and I"m running HAProxy 1.5 as a reverse proxy.
HAProxy has a SSL cert with a long list of SANs.
artifactrepo.company.com points to the main artifactory instance and works fine.
docker.company.com points to same server but HAProxy routes this to a Nexus served registry.
www.docker.company.com we intend to route to this Artifactory registry and
Per the HAProxy docs, I've set the reqirep ^([^\ :]*)\ /v2(.*$) \1\ /artifactory/api/docker/docker/v2\2 to get me to the intended port and path.
I have the "Registry Port" set to the default 6555 yet there is no process listening on that port. Artifactory and HAProxy have been restarted.
netstat -tulpn | grep 6555
gives no results.
Shouldn't Artifactory be listening on the Registry Port?
I figured this out. Turns out it was imagination poisoning from running Nexus repos.
Unlike Nexus, Artifactory doesn't actually listen on any port but the default (8081). The reference to a mapped port for a docker repo is simply to seed the generated reverse-proxy configs they give you. Those configs will have apache listen on 6555 (their default for docker) and then do the path rewrite and port map to 8081. I had intended to do this reverse-proxying using the hostname and had not scrolled all the way through their example to see that they had apache listening on 6555.

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"

Resources