我有浏览器和服务器上的IP地址abcd现在我有2个可能的URL到服务器: 通过浏览器通过Nginx browser -> https://abcd/ -> server 通过从WSS的WSS browser -> wss://abcd:10062 -> server 所以,443(nginx)上的服务器listnes和10062上的一些其他应用程序。我想要更改第二个连接到同一个端口(443): browser -> wss://abcd/someurl -> server 那么是否有可能在nginx中代理abcd:10062,如下所示: server { listen 80; listen 443 ssl; ssl_certificate /path/to/crt/for/https; ssl_certificate_key /path/to/key/for/https; server_name abcd; location /someurl { –>> What to write here to create redirect for wss://abcd:10062 ? << — } # the other locations here […]
我有nginx服务器发送404错误到1.1.1.1:8081 Apache httpd。 如何将所有原始标题传递给错误服务器? 我有以下configuration: server { error_page 404 = http://1.1.1.1:8081/404.php?remote=1; } 当在404.php中检查标题时,我得到客户端的原始ip,但没有来自客户端的cookie; 另外,我得到请求的uri设置为404.php?remote=1而不是导致404错误的url: <?php // 404.php file file_put_content("log.txt", $_SERVER['REQUEST_URI'], FILE_APPEND); // 🙁 file_put_content("log.txt", $_SERVER['REMOTE_ADDR'], FILE_APPEND); // Ok file_put_content("log.txt", $_COOKIE['MyCookie'], FILE_APPEND); // 🙁 empty ?>
我有一个网站运行单声道(在Debian延伸)。 我想有一些将由php5模块处理的子文件夹(例如webmail,stats和PhpMyAdmin)。 有一个简单的方法来做到这一点与Apacheconfiguration,或者我应该看看phalanger或其他解决scheme(代理)?
我试图在nginx中configuration一个代理,将所有代理请求绑定到特定范围内的随机IP地址。 每个代理请求将来自不同的IP地址。 我目前有下面的configuration。 但是,由于某些原因,即使configuration加载正常,nginx也不会侦听端口80。 尝试访问服务器时,连接被拒绝。 我是否在谈论这个错误? server { listen 80; listen [::]:80; server_name my.server.name; location / { # proxy all requests to destination proxy_pass https://destination; # generate random IPv6 between IPv6Prefix::0 and IPv6Prefix::13 set_by_lua_block $ip { return 'IPv6Prefix::' .. string.format('%x', math.random(0, 19)) } proxy_bind $ip; # keep connections alive proxy_http_version 1.1; proxy_set_header Connection ''; } […]
你好我试图路由stream量回到用户机器为了在本地运行一个站点,但拿起HAProxy提供的其他来源的标头/ cookies /路由逻辑。 到目前为止,我还没有弄清楚如何做到这一点。 该文档说使用环境variables是可用的https://cbonte.github.io/haproxy-dconv/configuration-1.5.html#4-server 地址string的任何部分都可以引用任意数量的环境variables,方法是使用美元符号('$')在名称前加上括号('{}'),类似于Bourne shell中所做的。 但我会想象有一种使用acl或样本获取的方式,但对于我来说,我无法弄清楚如何去做。 下面是我尝试过的一个例子。 我通过删除$ {hdr(originalIp)}并使用我的IP做了一个概念validation,但是我希望它能dynamic地使用请求者IP(如果存在的话) ### Sample config acl has_local_cookie cook_sub(local) -i true use_backend local if has_local_cookie backend local server local-origin ${hdr(originalIp)}:443 ssl verify none
我想使用这里给出的教程来设置squid3作为HTTPS代理。 我在浏览器中正确设置了代理设置,当我尝试访问HTTP网站时,我能够成功连接。 但是,每当我点击一个HTTPS协议网站时,我都会收到“连接超时错误”,并在我的/var/log/squid3/cache.log出现以下错误: 2016/06/20 19:12:47| NF getsockopt(SO_ORIGINAL_DST) failed on local=<local_ip_address>:3129 remote=<remote_ip_address>:55209 FD 8 flags=33: (92) Protocol not available 这里是我的/etc/squid3/squid.conf文件(为简洁起见删除了注释行): auth_param basic program /usr/lib/squid3/basic_ncsa_auth /usr/etc/passwd auth_param basic casesensitive off auth_param basic credentialsttl 2 hours acl user_auth proxy_auth REQUIRED http_access allow user_auth acl SSL_ports port 443 acl Safe_ports port 80 # http acl Safe_ports port 21 # […]
我需要制作一个logging鱿鱼代理每用户带宽使用情况的程序。 在我的access.log我看到输出如… 1481377143.042 0 104.123.25.183 TCP_DENIED/407 3829 CONNECT scontent.xx.fbcdn.net:443 – HIER_NONE/- text/html 1481377143.403 0 104.123.25.183 TCP_DENIED/407 3793 CONNECT cx.atdmt.com:443 – HIER_NONE/- text/html 1481377277.865 134623 104.123.25.183 TCP_MISS/200 4118 CONNECT scontent.xx.fbcdn.net:443 star7 HIER_DIRECT/2a03:2880:f022:b:face:b00c:0:3 – 1481377277.868 134626 104.123.25.183 TCP_MISS/200 4116 CONNECT scontent.xx.fbcdn.net:443 star7 HIER_DIRECT/2a03:2880:f022:b:face:b00c:0:3 – 我相信以字节为单位的响应大小应该在那里,但是哪个入口呢? 我意识到标题大小没有logging,所以准确性不会是完美的,但它应该是足够准确的。 我不知道有什么更好的方法来跟踪鱿鱼用户的带宽使用情况,所以这将不得不做的,但我需要知道哪些是大小条目。
我们有一个API后端服务器,需要某些包含下划线的HTTP头。 我知道,这不是最好的做法,标题应该使用连字符,但我不能改变这一点。 我们使用nginx作为代理服务器,并使用underscores_in_headers on选项。 这会导致nginx不删除这些头文件。 现在我们要切换到HAProxy,并在configuration更改之前将其作为nginx使用下划线删除标题。 有没有办法阻止HAProxy下拉字头?
我已经configurationnginx来代理到端口8000的请求,路由到不同的IP。 在configuration中,我还添加了Access-control-Allow-Origin头。 如果服务器响应2xx响应代码,这工作正常。 但是,如果服务器响应4xx响应代码,它不包括下面提到的头 server { listen *:8000; ssl on; ssl_certificate /etc/nginx/ssl/axis.crt; ssl_certificate_key /etc/nginx/ssl/axisPrivate.key; server_name website.com; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP; access_log /var/log/nginx/nginx.vhost.access.log; error_log /var/log/nginx/nginx.vhost.error.log; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_pass https://api; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_ssl_session_reuse off; proxy_set_header Host $http_host; proxy_redirect off; proxy_intercept_errors off; # Simple requests if ($request_method ~* […]
我正在运行一组使用基本浏览器身份validation的NGINX代理和用户的htpasswd文件。 我已经用Laravel构build了一个小应用程序来validation用户,并向他们展示了这些nginx代理的链接列表。 我正在寻找更新nginx身份validation像JWT令牌,但是我不知道如果没有一个API后面的APIvalidation实际的令牌本身是否足够安全? 我在想的另一个select是LDAP解决scheme,并使用Laravel和NGINX代理使用ldap身份validation。 nginx代理后面的应用程序没有任何身份validation,我们目前没有任何向他们添加任何的意图