Articles of 代理

鱿鱼TPROXY连接在特定网站上失败?

当squid设置为TPROXY时,在某些站点返回ERR_CONNECT_FAIL。 鱿鱼运行的服务器能够通过lynx,wget,curl等打开这些网站。 即使我们在浏览器中手动设置代理或使用简单的REDIRECT或DST-NAT,这些站点也可以打开。 从这个页面http://wiki.squid-cache.org/SquidFaq/InterceptionProxy 它导致pathMTU(PMTUD)失败,可能使一些远程站点无法访问 。 如果您的客户端计算机通过以太网或DSL PPPoATM连接,则caching与客户端之间的所有链路的MTU均为1500或更多,这通常不是问题。 如果您的客户通过DSL PPPoE连接,那么这可能是一个问题,因为PPPoE链路通常具有减less的MTU(1472很常见)。 但是我也有与以太网相同的问题 这里是一个客户端的tcpdump: 点击这里查看tcpdump当我使用tproxy和问题出现 和 点击这里查看tcpdump当我手动设置代理在我的浏览器和everyhting正常工作 GET / HTTP/1.0 Host: 80.75.1.4 Accept: text/html, text/plain, text/css, text/sgml, */*;q=0.01 Accept-Encoding: gzip, compress, bzip2 Accept-Language: en User-Agent: Lynx/2.8.8dev.2 libwww-FM/2.14 SSL-MM/1.4.1 HTTP/1.0 504 Gateway Time-out Server: squid Mime-Version: 1.0 Date: Wed, 27 Feb 2013 15:39:03 GMT Content-Type: text/html Content-Length: 376353 […]

httpd:如何dynamic延迟请求转发到代理?

我有Apache httpd(2.2.22)configuration为反向代理。 在这种情况下,我需要将我的Web服务器(代理请求的接收者)离线几毫秒。 在此期间,Web服务器不应收到任何请求,但我也不想拒绝任何请求。 我想要做的是以某种方式让httpd延迟这段时间的所有请求。 在步骤中: 告诉httpd延迟所有的请求,直到另行通知 停止Web服务器 启动networking服务器 继续从httpd转发请求 一个固定的延迟也可以做到这一点,但由于我无法预见Web服务器将离线的实际时间(除此之外它将不到一秒),dynamic方法将更适合。 我已经看过mod_proxy或mod_balancer如何能够帮助我,但我没有find一个明显的解决scheme。 我会很高兴你可以给我的任何指针。 编辑: 看起来像一个静态的方法就足够了。 一些有用的资源: httpd ProxyPass httpd ProxyTimeout ProxyPass与mod_rewrite (无需明确使用ProxyPass;不需要使用ProxyPassInterpolateEnv) 另请参阅这篇文章 ,讨论关于httpd返回503立即(代理和平衡器)的讨论。 替代scheme: 我们将把systemd部署到我们的服务器上。 systemd将解决我的问题,因为它可以保留在一端closures的套接字的请求。 这意味着,当我停止后端服务器很短的时间,所有的请求将排队,直到我再次启动并连接到套接字。 这就是我所说的优雅:)

Gitlab与Apache代理

我有一台运行在Mac OS X机器上的apache2服务器,与在虚拟机上运行Gitlab的机器相同。 Mac IP:192.168.0.7 Ubuntu(虚拟)IP:192.168.0.12 我希望apache将gitlab.mydomain.com转到Ubuntu虚拟机,而anythingelse.mydomain.com转到Mac。 我添加了一个文件(gitlab.mydomain.conf)到/private/etc/apache2/other/ (在Mac上),内容如下 <VirtualHost *:80> ServerName gitlab.mydomain.com ProxyPass / http://192.168.0.12 ProxyPassReverse / http://192.168.0.12 ProxyPreserveHost On </VirtualHost> Ubuntu虚拟机文件中的gitlab.yml包含 ##Gitlab settings gitlab: ## Web server settings host: gitlab.mydomain.com port: 80 https: false 当我去gitlab.mydomain.com我得到以下错误: Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not […]

Apache作为Nexus,Jenkins和Foreman的代理(在相同域,IP和端口上的多个VirtualHost)

我想将Apacheconfiguration为在同一台服务器上安装并运行的Nexus,Jenkins和Foreman的代理。 这里是Foreman的虚拟主机configuration文件的示例,Nexus和Jenkins的其他文件看起来非常相似,除了代理传递参数。 LoadModule ssl_module modules/mod_ssl.so NameVirtualHost *:443 <VirtualHost *:443> SSLEngine On SSLProxyEngine On SSLCertificateFile /etc/httpd/ssl/certs/ssl.crt SSLCertificateKeyFile /etc/httpd/ssl/keys/server.key ServerName management.domain.com <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass /foreman http://127.0.0.1:3000/foreman ProxyPassReverse /foreman http://127.0.0.1:3000/foreman ProxyPassReverse /foreman http://management.domain.com/foreman ProxyRequests Off ProxyPreserveHost On ErrorLog /var/log/httpd/management.domain.com_foreman_error.log LogLevel warn CustomLog /var/log/httpd/management.domain.com_foreman_access.log combined </VirtualHost> 问题是,Apache只考虑了一个configuration文件,而忽略了另外两个导致错误信息“请求的URL / jenkins /在这个服务器上找不到的”。 当我尝试访问URL management.domain.com/jenkins 如何configurationApache来加载这三个虚拟主机? […]

nginx服务404上的备用位置

我试图build立一个nginxconfiguration如下:当收到像/tile/SteveCountryVic/1/2/3.png的请求: 尝试将其传递给http://localhost:5005/1/2/3.png 如果那404s,传递给另一台服务器作为/tile/SteveCountryVic/1/2/3.png 这是我的configuration,这是不是很工作: server { listen 80; server_name localhost; error_log /tmp/nginx.error.log notice; access_log /tmp/nginx.access.log; location /tile/SteveCountryVic/ { rewrite_log on; #rewrite ^.*/(\d+)/(\d+)/(\d+).*$ /$1/$2/$3.png break; proxy_intercept_errors on; error_page 404 = @dynamiccycletour; #proxy_set_header Host $http_host; #proxy_pass http://127.0.0.1:5005; proxy_redirect /tile/SteveCountryVic/ http://localhost:5005/; location @dynamiccycletour { rewrite_log on; #rewrite ^(\d+)/(\d+)/(\d+).*$ /tile/SteveCountryVic/$1/$2/$3.png break; proxy_pass http://115.xxx:20008; } location /tile/ { proxy_set_header Host […]

鱿鱼指定传出networking接口

我有一个Linux Debian机器,它有很多运行Squid的networking接口(venet0:1到venet0:5)。 如果我连接到接口venet0:2 squid使用venet0:0作为传出stream量,但我希望Squid使用相同的networking接口进行连接。 所以如果我连接到venet0:1的IP地址,代理也应该使用相同的接口传出stream量。 目前我使用以下configuration: http_port 200 forwarded_for off uri_whitespace encode visible_hostname localhost via off collapsed_forwarding on auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/users auth_param basic children 5 auth_param basic realm Proxy auth_param basic credentialsttl 2 hours auth_param basic casesensitive off acl ncsa_users proxy_auth REQUIRED access_log none cache_store_log none cache_log /dev/null acl all src all http_access […]

为什么不能nginx超过75秒的代理连接等待?

根据这里的文档,nginx proxy_connect_timeout不能有超过75秒的延迟。 我知道可怕的是有一个延迟的应用程序,但我很好奇为什么这个确切的价值?

NFSv4通过portforward

我想通过端口转发到达我的NFSv4服务器。 这个大计划将是在本地主机上运行的HAProxy负载平衡的NFSv4服务器集群。 但现在这并不重要。 在服务器上, /etc/exports看起来像这样 /mnt/x 192.168.0.0/16(rw,sync,no_subtree_check,no_root_squash,fsid=1) 我可以从我的客户端连接到TCP 2049上的服务器,并像这样安装共享 mount -t nfs4 -o proto=tcp,port=2049 192.168.2.25:/mnt/x /mnt 我testing了NFVs4很高兴只有这一个TCP端口打开通过过滤两台机器之间的所有其他通信。 所以我认为NFS运行良好。 但是,当我转发一个端口例如与客户端的redir到服务器 redir –lport=3049 –cport=2049 –caddr=192.168.2.25 并想要如下安装它 mount -t nfs4 -o proto=tcp,port=3049 127.0.0.1:/mnt/x /mnt 我明白了 mount.nfs4: Operation not permitted 我想念什么? 我在服务器日志中看不到任何相关的信息。 更新:我捕获了好的和不好的连接尝试,一开始他们是相同的,然后客户端发送一个 PUTROOTFH,GETFH,GETATTR 命令。 在好的情况下服务器响应 PUTROOTFH-NFS4_OK,GETFH-NFS4_OK,GETATTR-NFS4_OK 在不好(转发)的情况下,它回应 PUTROOTFH-NFS4_OK,GETFH-NFS4_OK,GETATTR-NFS4ERR_PERM 这一点我改变了出口 /mnt/x 0.0.0.0/0.0.0.0(rw,sync,no_subtree_check,no_root_squash,fsid=1) 但是错误是一样的。 在好的情况下,服务器日志是 rpc.mountd[1711]: nfsd_export: inbuf '0.0.0.0/0.0.0.0 /' […]

作为代理服务器运行时的Apache服务器状态

我们运行Apache作为代理服务器,并在Apache后面有tomcat。 我们正在使用server_status模块,但是当我们尝试访问server_status在https://host.com/server-status它redirect到tomcat,我们得到404错误。 我对此很新,尝试通过Apache文档,但无法找出解决scheme。 Fyi.We启用了ssl 当前的ssl.conf设置: ProxyRequests Off ProxyPreserveHost On <Proxy http://localhost:8081/*> Order deny,allow Allow from all </Proxy> ProxyPass / http://localhost:8081/ ProxyPassReverse / http://localhost:8081/ ProxyPassReverse / http://myhost:8081/ <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from 10.90 </Location> build议更改后 ProxyRequests Off ProxyPreserveHost On <Proxy http://localhost:8081/*> Order deny,allow Allow from all </Proxy> ProxyPass /server-status ! […]

Apache反向代理到8080端口的tomcat应用程序在响应头中给出错误的URL

我有Apache(2.2)服务器与以下configuration反向代理到应用程序运行在8080端口上的tomcat(6)。 …. ServerName ext-domain ProxyPreserveHost On ProxyPass /myapp http://int-domain:8080/myapp ProxyPassReverse /myapp http://int-domain:8080/myapp …. 当我从浏览器访问URL下面 "http://ext-domain/myapp" 我在浏览器地址栏中获取下面的URLreplace。 "http://ext-domain:8080/myapp" 和Apache访问日志说… "GET /myapp HTTP/1.1" 302 421 "-" "Mozilla/5.0"… 如何避免在端口8080插入响应URL? 有人可以帮助吗? 谢谢。