Articles of 代理

Nginx代理到SSL客户端证书authentication的后端

我有两台服务器,都有nginx。 服务器A正在侦听443,并configuration为使用客户端SSL证书进行身份validation。 服务器B有一个内部进程需要通过nginx与服务器A进行通信。 我想在服务器B上configurationNginx,它将侦听8080(不encryption,因为它是全部本地通信),并且proxy_pass到ServerA:443。 问题是如何注入客户证书? 我没有find任何proxy_xxxx函数。 我知道如何使用与socat相当的,但我的要求是使用nginx。

tinyproxyauthentication

我很困惑如何在tinyproxy上设置用户名/密码限制(以便不是所有的人都可以访问它 – ip alow / block在我的设置中使用有限)。 任何指针? 谢谢!

Nginx没有caching数据

我有一个nginx代理后面的REST API。 代理工作正常,但我无法caching任何答复。 任何帮助将不胜感激: Nginxconfiguration: worker_processes 10; error_log logs/error.log; error_log logs/error.log notice; error_log logs/error.log info; pid logs/nginx.pid; events { worker_connections 1024; } http { proxy_cache_path /path/to/cache/dir keys_zone=one:60m; proxy_cache_methods GET HEAD POST; upstream backend { server server1 backup; server server2 weight=5; } access_log logs/access.log; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { […]

configurationPHP以使用代理?

使用PHP 5.2.6,需要将其configuration为使用我们的转发代理(需要进行身份validation),以便PHP脚本可以正确连接到Internet。 我发现4版本中的PHP.INI有一个pfpro.proxyaddress选项,但是这个选项已经不可用 – 那么replace它是什么?

如何在MacOSX Leopard中激活ssh-agent确认?

我有MacOSX Leopard(10.6.2)的MacBook,我用SSH连接到一些服务器(他们的操作系统是Debian Lenny)。 我使用RSA密钥login到服务器A ,并从那里“反弹”到其他服务器B , C和D. 我已经在服务器A的笔记本电脑的.ssh/config激活了代理转发,以便能够连接到A ,然后从A到B , C或D “跳动”,而不必每次input密码。 它工作正常。 但是我看到代理转发有一个安全缺陷:如果黑客在服务器A上获得root权限,他将能够劫持代理转发机制,并连接到服务器B , C和D,而不需要任何密码。 显然,一个解决scheme是使用ssh-add的-c选项:每次服务器A想要使用我的RSA密钥时,都要求我确认。 但由于某种原因,它失败了: miniquark@mylaptop:~$ ssh-add -c Enter passphrase for /Users/miniquark/.ssh/id_rsa: Identity added: /Users/miniquark/.ssh/id_rsa (/Users/miniquark/.ssh/id_rsa) The user has to confirm each use of the key miniquark@mylaptop:~$ ssh serverA Agent admitted failure to sign using the key. miniquark@serverA's password: 通常,我不需要手动启动ssh-add ,因为当我启动一个需要RSA密钥的ssh连接时,MacOSX会自动为我启动。 所以也许解决办法是configurationMacOSX来启动带-c选项的ssh-add […]

nginx即使通过操作系统parsing,也无法parsing重新装载的上游名称

当重新加载configuration(特别是对于proxy_pass) – 偶尔会看到:nginx:[emerg] host not found in upstream 但是 – 上游服务器的名字将在os(linux)中解决 – 只有nginx似乎有这个问题。 这似乎是最近的回归 – 因为它似乎没有发生在1.0.10版之前。 有没有人最近注意到这个? 试图缩小search范围。

Nginx在使用https访问时从错误的“虚拟主机”提供内容

我有一台服务器在代理设置中同时运行Nginx和Apache,Nginx为静态内容和Apache提供了非常好的dynamic内容。 这个设置目前正在托pipe同一个网站的两个版本,可以称之为production.com和staging.com。 我刚刚完成了使用SSL的production.com网站的设置,但也发现,如果我使用SSL浏览到staging.com,则会获得production.com网站根目录的内容,这显然是错误的。 我被告知使用SSL和非SSL的默认处理程序,这将消除这种行为,但这是我有麻烦的地方。 现在我有这个configuration包含在nginx.conf default_80.conf server { listen 80; server_name ""; return 444; } default_443.conf server { listen 443 default_server ssl; server_name ""; return 444; } staging.com.conf server { listen 80; server_name staging.com; access_log /var/log/nginx/staging.com.log; # static content folders location ^~ /(images|css|js) { root /var/www/staging.com/current; access_log /var/log/nginx/staging.com.static.log; } # static content files location ~* […]

是否有可能取代通过代理传递的每个页面上的内容,类似于如何使用mod_rewrite URL?

是否有可能取代通过代理传递的每个页面上的内容,类似于如何使用mod_rewrite URL? 替代文件不清楚。 我有一些页面我是反向代理,有绝对path。 这打破了网站。 他们需要更换和像mod_rewrite这样的工具不拾起它们,因为它们不是URL请求。 <VirtualHost *:80> ServerName servername1 ServerAlias servername2 ErrorLog "/var/log/proxy/jpuat_prox_error_log" CustomLog "/var/log/proxy/jpuat_prox_access_log" common RewriteEngine on LogLevel alert rewrite:trace2 RewriteCond %{HTTP_HOST} /uat.site.co.jp$ [NC] RewriteRule ^(.*)$ http://jp.uat.site2uk.co.uk/$1 [P] AddOutputFilterByType SUBSTITUTE text/html Substitute "s|uat.site.co.jp|jp.uat.site2uk.co.uk|i" ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://uat.site.co.jp/ ProxyPassReverse / http://uat.site.co.jp/ </VirtualHost> 上述两种方法都不能替代HTMLstring <link href="//uat.site.co.jp/css/css.css […]

mod_deflate – 大多数浏览器的最佳configuration

我想知道如果有人在这里可以帮助我确定使用mod deflate与Apache的最佳标准configuration。 基本上,mod_deflatebuild议使用以下configuration立即开始: 只压缩几个types AddOutputFilterByType DEFLATE text / html text / plain text / xml http://httpd.apache.org/docs/2.0/mod/mod_deflate.html 但是,只需阅读文档,就可以为所有浏览器自定义此文档。 另外,你可以为所有不同types的MIMEtypes定制mod_deflate。 我想知道有没有人试过这些设置,并find了一个最适合所有浏览器的设置。 Apache提供的另一个示例,但是如果您不了解所有configuration选项,请提及不要使用: <Location /> # Insert filter SetOutputFilter DEFLATE # Netscape 4.x has some problems… BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine […]

nginx:为什么我不能把proxy_set_header放在if子句中?

有了这个configuration: server { listen 8080; location / { if ($http_cookie ~* "mycookie") { proxy_set_header X-Request $request; proxy_pass http://localhost:8081; } } } 我在重新加载nginx服务时出现此错误: Reloading nginx configuration: nginx: [emerg] "proxy_set_header" directive is not allowed here in /etc/nginx/conf.d/check_cookie.conf:5 nginx: configuration file /etc/nginx/nginx.conf test failed 这个configuration工作正常,但它没有做我想要的: server { listen 8080; location / { proxy_set_header X-Request $request; if ($http_cookie ~* […]