AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[http-proxy](server)

Martin Hope
lolc
Asked: 2021-10-21 12:38:49 +0800 CST

阻止特定端口上的传出流量而不阻止内部流量

  • 0

我在端口 3000 上托管服务。使用 apache,我将其https://git.mywebsite.com代理到http://mywebsite.com:3000. 现在,如果我输入以下命令:

sudo iptables -A INPUT -p tcp --dport 3000 -j DROP

它确实阻止了外部用户访问http://mywebsite.com:3000,但现在 apache 也不能再在内部访问它,这意味着https://git.mywebsite.com也关闭了。有没有办法来解决这个问题?

proxy iptables http-proxy
  • 1 个回答
  • 122 Views
Martin Hope
Mostafa Soufi
Asked: 2020-03-08 02:03:22 +0800 CST

Squid Http 代理在 git clone 中不起作用

  • 0

我已经通过 Docker 安装了 Squid并使用 curl 和浏览器进行了测试,它工作正常!

然后我要设置 Http 代理到 git,下面是我的命令:

git config --global http.proxy http://myserverip:3128

然后,这是 git config 中上述命令的结果。

$ cat ~/.gitconfig
[http]
    proxy = http://squid.veronalabs.com:3128
    sslVerify = false

但是 git clone 不起作用!

$ git clone [email protected]:repo/project.git
Cloning into 'panel'...
ssh: connect to host gitlab.com port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

无论如何,我已经为传出连接添加了这个代理:

$ export http_proxy=http://myserverip:3128
$ export https_proxy=http://myserverip:3128

我真的很感激任何帮助!

proxy squid git http-proxy
  • 1 个回答
  • 1318 Views
Martin Hope
Ales Dokshanin
Asked: 2016-04-19 03:31:43 +0800 CST

Squid cache_peer 循环算法未按预期工作

  • 2

我有许多点对点HTTP 代理,我需要在它们之间平均分配我的请求,所以我添加了多个cache_peer指令并将循环设置为对等选择算法。这是我的配置:

# Basic configuration
visible_hostname squid_proxy_1
unique_hostname squid_proxy_1

http_port 3130
pid_filename /vagrant/squid_proxy_1.pid


cache deny all
http_access allow all

# Proxies
cache_peer MY_PROXY_HOST parent PROXY_PORT 0 round-robin no-query name=FIRST login=MY_PROXY_LOGIN-1:PASSWORD1
cache_peer MY_PROXY_HOST parent PROXY_PORT 0 round-robin no-query name=SECOND login=MY_PROXY_LOGIN-2:PASSWORD2
cache_peer MY_PROXY_HOST parent PROXY_PORT 0 round-robin no-query name=THIRD login=MY_PROXY_LOGIN-3:PASSWORD3

never_direct allow all

但是我遇到了以下问题:cache_peer开关不是在每次请求之后进行的。这是我的access.log的样子:

sudo tail -f /var/log/squid3/access.log
1460977613.775  23783 127.0.0.1 TCP_MISS/200 11371 GET http://www.google.com/ - ROUNDROBIN_PARENT/104.131.79.140 text/html
1460977621.171   4843 127.0.0.1 TCP_MISS/200 11413 GET http://www.google.com/ - ROUNDROBIN_PARENT/104.131.79.140 text/html
1460977628.367   5583 127.0.0.1 TCP_MISS/200 11412 GET http://www.google.com/ - ROUNDROBIN_PARENT/104.131.79.140 text/html
1460977634.270   4726 127.0.0.1 TCP_MISS/200 11354 GET http://www.google.com/ - ROUNDROBIN_PARENT/104.131.79.140 text/html
1460977642.429   6531 127.0.0.1 TCP_MISS/200 12841 GET http://www.google.com/ - ROUNDROBIN_PARENT/104.131.79.140 text/html
1460977645.563   1747 127.0.0.1 TCP_MISS/200 11360 GET http://www.google.com/ - ROUNDROBIN_PARENT/104.131.79.140 text/html
1460977653.731   7242 127.0.0.1 TCP_MISS/200 11408 GET http://www.google.com/ - ROUNDROBIN_PARENT/107.170.96.123 text/html
1460977658.559   3763 127.0.0.1 TCP_MISS/200 11374 GET http://www.google.com/ - ROUNDROBIN_PARENT/45.55.163.40 text/html
1460977660.516   1387 127.0.0.1 TCP_MISS/200 11398 GET http://www.google.com/ - ROUNDROBIN_PARENT/45.55.163.40 text/html
1460977662.863   1758 127.0.0.1 TCP_MISS/200 11414 GET http://www.google.com/ - ROUNDROBIN_PARENT/45.55.163.40 text/html
1460977664.667   1305 127.0.0.1 TCP_MISS/200 11419 GET http://www.google.com/ - ROUNDROBIN_PARENT/45.55.163.40 text/html
1460977676.157  10901 127.0.0.1 TCP_MISS/200 11384 GET http://www.google.com/ - ROUNDROBIN_PARENT/45.55.163.40 text/html
1460977678.565   1348 127.0.0.1 TCP_MISS/200 11321 GET http://www.google.com/ - ROUNDROBIN_PARENT/45.55.163.40 text/html
1460977681.742   2516 127.0.0.1 TCP_MISS/200 11383 GET http://www.google.com/ - ROUNDROBIN_PARENT/45.55.163.40 text/html

仅当我使用这些特定的 P2P 代理时才会发生这种情况。我尝试使用在实习生中找到的免费代理进行相同的配置,一切正常。

我想问题是 Squid 可能认为我的代理已死(因为它们有时真的很慢),因此我们没有将流量路由到它们,但我不确定。

有没有办法获得有关对等选择算法的更多信息?我可以以某种方式调整cache_peer选项来解决这个问题吗?

ubuntu load-balancing squid http-proxy round-robin
  • 1 个回答
  • 2470 Views
Martin Hope
sorin
Asked: 2014-05-10 05:39:23 +0800 CST

如何将 netscaler 配置为简单的 HTTP 代理?

  • 0

我想开始使用 netscaler 实例作为 HTTP 代理(如 squid),所以来自浏览器的所有请求都将直接发送到 netscaler。

我怎样才能获得这种行为?

注意:Netscaler 已配置为处理来自 VIP 接口上的 80 和 443 端口的请求。

我仍然希望允许它处理任何请求。

注意:如果您想知道为什么,主要动机是出于测试目的,告诉人们在浏览器中配置 HTTP 代理而不是修改主机文件以强制少数网站使用不同的服务器要容易得多。

通过这样做,我可以轻松地对 netscaler 配置进行 A/B 测试。

http-proxy
  • 1 个回答
  • 14239 Views
Martin Hope
vfclists
Asked: 2012-05-18 23:49:43 +0800 CST

仅在选定的目的地使用 OpenVPN 网关?

  • 1

是否可以在客户端上设置 OpenVPN,以便网关仅用于选定的目的地?

我已经阅读了这个答案OpenVPN make redirect-gateway optional on making use of the gateway optional, via push-reset。

如果任何客户端配置为通过 VPN 路由某些目的地,通过使用 FoxyProxy 或更改路由表,转发是否会正常工作?

openvpn http-proxy redirection
  • 1 个回答
  • 1019 Views
Martin Hope
LearningIT
Asked: 2010-04-09 12:25:33 +0800 CST

如何使用 Apache 中的代理模块重定向 URL?

  • 8

这似乎是一个超级基本的问题,但我很难找到一个简单的解决方案,所以感谢您在这方面的任何帮助和耐心:

我想将我的 Apache 代理服务器配置为重定向某些 URL,例如,将 www.olddomain.com 的 Web 浏览器 HTTP 请求传递给代理服务器,然后将请求路由到 www.newdomain.com,后者发送响应到代理服务器,然后将其传递回 Web 浏览器。

看起来很简单,但我不知道如何在 Apache 上实现这一点。我知道 Squid/Squirm 提供了这个功能,所以我猜我错过了一些非常基本的东西。我知道我可以使用 RewriteRule 动态修改 URL 并将其传递给代理服务器,但我实际上想做相反的事情,即代理服务器接收原始 URL,应用 RewriteRule,然后将 HTTP 请求转发给新的网址。

希望这是有道理的。提前感谢您的帮助。

apache-2.2 redirect http-proxy
  • 2 个回答
  • 73402 Views
Martin Hope
Jack Kada
Asked: 2010-02-25 02:01:19 +0800 CST

在 Windows 上将 Lynx 设置为 Web 浏览器 - 代理混乱

  • 1

我需要在我的机器上使用 Lynx - 唯一的问题是公司有一个代理,他们强迫我们使用并且不能通过

我看过 lynx.cfg 但我不明白如何强制它使用代理

有人可以帮忙吗?

我正在使用 Windows

web http-proxy
  • 1 个回答
  • 2508 Views
Martin Hope
morgant
Asked: 2010-01-20 13:43:37 +0800 CST

为什么我的 HAProxy 内容切换配置中出现错误?

  • 3

我正在将一些基础架构从托管特定站点的多个服务器迁移到在 OpenBSD 4.6 macppc 上使用HAProxy 1.3.15.7 的负载平衡架构。自然,我从为当前设置(特定服务器上的特定站点)配置内容切换开始,我的 /etc/haproxy/haproxy.cfg 如下:

global
    log 127.0.0.1   local0
    log 127.0.0.1   local1 notice
    #log loghost    local0 info
    maxconn 1024
    chroot /var/haproxy
    uid 604
    gid 604
    daemon
    #debug
    #quiet
    pidfile /var/run/haproxy.pid

defaults
    log     global
    mode    http
    option  httplog
    option  dontlognull
    option  redispatch
    retries 3
    maxconn 2000
    contimeout      5000
    clitimeout      50000
    srvtimeout      50000
    stats enable
    stats auth user:pass

frontend http_proxy *:80
    # check to see which domain the reguest is for
    acl host_tld.domain.sub1 hdr_end(host) sub1.domain.tld
    acl host_tld.domain.sub2 hdr_end(host) sub2.domain.tld
    # send to the correct server
    use_backend server2 if host_tld.domain.sub1 or host_tld.domain.sub2
    default_backend server1

backend server1
    server httpd_server1 192.168.1.3:80

backend server2
    server httpd_server2 192.168.1.4:80

目标是为所有域提供服务,server1除了域sub1.domain.tld&sub2.domain.tld应该被抛出server2。但是,当我尝试启动 HAProxy 时,出现以下错误:

parsing /etc/haproxy/haproxy.cfg : backend 'server2' has no dispatch address and is not in transparent or balance mode.
parsing /etc/haproxy/haproxy.cfg : backend 'server1' has no dispatch address and is not in transparent or balance mode.
Errors found in configuration file, aborting.
Error reading configuration file : /etc/haproxy/haproxy.cfg

我查看了 HAProxy 1.3 文档和http://upstre.am/2008/01/09/using-haproxy-with-multiple-backends-aka-content-switching/中列出的示例,但没有看到我哪里出错了。这些示例似乎都不需要option transparent平衡模式。此外,dispatch1.3 文档中奇怪地省略了该选项的文档,但我怀疑它对我的故障排除有帮助。

我哪里出错了?

openbsd http-proxy haproxy
  • 1 个回答
  • 4336 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve