尝试我的运气她的StackOverflow不是正确的地方问。 希望这是我的问题所在! 最近几天,我一直在拉我的头发,使websocket与Apache2.4一起工作。 我终于find了适合我的解决scheme,即: <VirtualHost *:80> ServerName www.domain2.com RewriteEngine On RewriteCond %{REQUEST_URI} ^/socket.io [NC] RewriteCond %{QUERY_STRING} transport=websocket [NC] RewriteRule /(.*) ws://localhost:3001/$1 [P,L] ProxyPass / http://localhost:3001/ ProxyPassReverse / http://localhost:3001/ </VirtualHost> 问题? 那么,只要我切换到wss,我是不走运的。 起初,我希望能够把ws改成wss以上,但是这并没有办法,我仍然得到了一个500错误。 我可能会错过什么? (我使用socket.io,请求如下所示: wss://xxx.yy/socket.io/?auth=YYY&EIO=3&transport=websocket&sid=XXX
我试图部署我的瓶apirestnginx(在子域上)没有成功。 我已经按照这个例子从数字海洋和一切工作正常,但后来我改变了教程示例代码我的我的和POST请求根本不工作。 我正在使用Postman Chrome应用程序,每次我做一个POST请求到“api.domain.com/CreateUser”我得到一个404错误: “在服务器上找不到请求的URL,如果你手动input了URL,请检查你的拼写,然后重试。 这是我的VHconfiguration: server { listen 80; server_name api.domain.com; location / { include proxy_params; proxy_pass http://unix:/home/ubuntu/apirest/apirest.sock; } } 这是python文件(flask api示例): from flask import Flask, jsonify, url_for, redirect, request from flask_restful import Resource, Api, reqparse from flask_cors import CORS, cross_origin app = Flask(__name__) CORS(app) api = Api(app) class CreateUser(Resource): def post(self): return jsonify({ […]
我在我的apache服务器上有一个SSL主机,在VirtualHost中有以下内容: <VirtualHost 217.147.92.100:443> ServerName server.com ServerAdmin [email protected] DocumentRoot /somepath/ ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined SSLEngine on SSLCertificateFile /etc/something/fullchain.pem SSLCertificateKeyFile /etc/something/privkey.pem <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory /usr/lib/cgi-bin> SSLOptions +StdEnvVars </Directory> BrowserMatch "MSIE [2-6]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 # MSIE 7 and newer should be able to use keepalive BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown SSLProxyEngine […]
我有一个在http和websocket上都回复的应用程序:它在公司服务器场之外托pipe。 这个应用程序既可以通过浏览器/ websocket使用,也可以通过http从SF(server2server)中运行的应用程序使用。显然,由于我们正在谈论两个单独的networking,因此S2S需要更高的套接字和连接超时。 我想把这个应用程序放在我们的服务器场中,但是我的公司说这是危险的,因为它暴露了我们的内部IP地址。 我们目前正在支持一个着名的不支持websocket的CDN – 在SF内移动这个应用程序的风险是什么,并且有第二个CDN支持只代理这个应用程序的websockets? 为什么它比正常的http连接更危险? 开放的TCP通道会直接暴露CDN后面的服务器吗? 谢谢
从NEredirect, 我在使用websocketbuild立连接时遇到问题。 netstat控制台输出 仅供参考,我们希望连接的目标是10.121.244.17:45678这是一个套接字服务器的实例。 有问题的可执行文件覆盖在红色,让说,代表ABC.exe。 正如你在控制台中看到的,这两个连接到套接字服务器的请求都被redirect到了116.206.196.77:3128,我不确定它是否是防火墙。 这是因为我已经使用puttyTel.exe来testing套接字服务器的连接,并且它可以在控制台输出中看到。 另外,ping到116.206.196.77的地址返回请求超时。 因此,有什么办法可以知道什么时候SYN请求被redirect到这个地址?
我无法让Passenger在重新启动nginx时启动我的Nodejs(iojs)应用程序。 我已经按照教程安装了先决条件: $ nginx -V nginx版本:nginx / 1.8.0 configuration参数:–with-cc-opt =' – g -O2 -fstack-protector -param = ssp-buffer-size = 4 -Wformat ……… –add-module = / tmp / buildd / nginx-1.8 0.0 /的Debian /模块/乘客/ EXT / nginx的 在http块启用: passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini; passenger_ruby /usr/bin/passenger_free_ruby; passenger_nodejs /usr/local/bin/node; passenger_default_user staging; passenger_default_group www-data; 然后在服务器块中: upstream instance { # point to node instance […]
在select采用Websocket作为我公司Web应用程序背后的实时技术时,我试图确定服务器工作负载是什么。 据我了解的Apache内部,我相信一个Apache进程或线程将保持在整个Websocket会话代理与mod_proxy_wstunnel的连接保持活跃; 这个过程是否也会处理传统的客户端http请求? 或者当他们到达时,另一个进程被浪费了吗?
我有一组如下所示的iptable规则: -A PREROUTING –jump intercept-nat -A intercept-nat –jump DNAT -s 10.10.1.0/24 ! -d 10.10.1.1/32 -p tcp -m tcp –dport 80 –to-destination 10.10.1.1:3126 -m comment –comment "intercept-nat" -A intercept-nat –jump DNAT -s 10.10.1.0/24 ! -d 10.10.1.1/32 -p tcp -m tcp –dport 443 –to-destination 10.10.1.1:3127 -m comment –comment "intercept-nat" -A intercept-nat –jump DNAT -s 10.1.2.0/24 ! -d […]
在我的Apache 2.4虚拟主机我试图让所有的https://stream量继续到端口443,但所有ws://stream量转发到ws://*:6969 。 例如: 正常情况下, https://example.com/index:443 https://example.com/index //example.com/index只会转到https://example.com/index:443 。 ws://example.com/anypathhere/将被转发到ws://example.com/anypathhere:6969 到目前为止,我已经尝试了在vhost中注释掉的值。 <VirtualHost *:443> SSLEngine on SSLCertificateFile /etc/pki/tls/certs/ca.crt SSLCertificateKeyFile /etc/pki/tls/private/ca.key DocumentRoot /var/www/html/ RewriteOptions Inherit AccessFileName .htaccess AllowEncodedSlashes NoDecode DirectoryIndex disabled <Directory /var/www/html> Options +FollowSymlinks RewriteEngine On AllowOverride All Require all granted RewriteCond %{REQUEST_FILENAME} -d RewriteRule .* %{REQUEST_URI}index.php [L] </Directory> ServerName localhost.localdomain #ProxyPreserveHost On #ProxyRequests Off #ProxyPassMatch […]
我一直在使用Apache作为我的Socket.io服务器的负载平衡器。 我经历了以下的话题,现在一切似乎都没有问题。 为Socket.IO 1.0configurationApache 2.4 mod_proxy_wstunnel 我使用以下configurationconfiguration了Apache,现在连接正在升级到WebSocket。 但是当我尝试为以下configuration启用粘性会话时,似乎有时候apache将路由升级请求路由到路由#2,同时在路由#1上build立轮询。 发生这种情况时,升级失败,websocket未连接。 因为我们必须使用平衡器(一个用于http,一个用于ws),所以我想也许http路由#1设置的cookie不能被ws路由访问,这就是为什么会话在http和ws之间不粘连的原因。 我使用的是Apache 2.4.9 <VirtualHost *:8080> Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED ProxyRequests off ServerName localhost <Proxy balancer://http-localhost/> BalancerMember http://localhost:8081 route=1 keepalive=On smax=1 connectiontimeout=10 retry=600 timeout=900 ttl=900 BalancerMember http://localhost:8082 route=2 keepalive=On smax=1 connectiontimeout=10 retry=600 timeout=900 ttl=900 ProxySet lbmethod=byrequests ProxySet stickysession=ROUTEID </Proxy> <Proxy balancer://ws-localhost/> BalancerMember ws://localhost:8081 route=1 keepalive=On […]