微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

nginx与websocket和https内容在相同的url

我的服务器在根urlhttps:

文件,其余资源

的WebSocket

我想我的configuration支持websocket,但它不工作。

我使用支持websocket代理的Nginx 1.3.16。

这是我的Nginxconfiguration的一部分:

PHP启用<?=?>

Nginx的代理或重写取决于用户代理

Redis,redis致命错误无法打开configuration文件

htaccess文件PHP包括目录,以及windows的XAMPPconfiguration噩梦

如何让Apache的configuration单元来处理多个客户端的查询

map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { listen 443 default ssl; server_name localhost; ssl on; ssl_certificate ssl/server.crt; ssl_certificate_key ssl/server.key; ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers RC4:HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; keepalive_timeout 60; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; ### We want full access to SSL via backend ### location / { proxy_pass http://localhost:8080; ### force timeouts if one of backend is died ## proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; ### Set headers #### proxy_set_header Accept-Encoding ""; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; ### Most PHP,Python,Rails,Java App can use this header ### #proxy_set_header X-Forwarded-Proto https;## #This is better## proxy_set_header X-Forwarded-Proto $scheme; add_header Front-End-Https on; ### By default we don't want to redirect it #### proxy_redirect off; } location /writever/chat { proxy_pass http://localhost:8080/writever/chat; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }

这里是我在Nginx中看到的错误

2013/04/23 22:41:52 [error] 17011#0: *2093 upstream timed out (110: Connection timed out) while reading response header from upstream,client: 127.0.0.1,server: localhost,request: "GET /writever/chat?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=1.0.12&X-Atmosphere-Transport=websocket&X-Cache-Date=0&Content-Type=application/json&X-atmo-protocol=true HTTP/1.1",upstream: "http://127.0.0.1:8080/writever/chat?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=1.0.12&X-Atmosphere-Transport=websocket&X-Cache-Date=0&Content-Type=application/json&X-atmo-protocol=true",host: "localhost"

我不确定这两个位置是否可以一起工作,如果顺序很重要,就像“/”包含/编写/聊天。

任何帮助将不胜感激。

更新:我有一个以前的Nginx版本。 清理后,一切似乎工作正常。 所以我会保持这个configuration,直到我find一个问题或更好的东西。 我会让你知道的。

无法保存applicationHost.config文件

Nginx中找不到位置块

用Freetype2为ARM构buildFFmpeg

为什么我的PHP标签转换为html评论

我应该在哪里存储适用于非漫游用户的机器范围的应用程序设置?

如上所示,我的问题是Nginx安装不正确。

卸载任何版本<1.3.13-(做一个sudo updatedb;找到Nginx确保),然后安装新版本。

目前,你必须手动完成(不支持apt-get):

sudo apt-get install build-essential libssl-dev zlib1g-dev

PCRE

cd ~/src #make this if it doesn't exist wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz tar -xzvf pcre-8.30.tar.gz cd pcre-8.3X/ ./configure # /usr/local is the default so no need to prefix make sudo make install sudo ldconfig # this is important otherwise Nginx will compile but fail to load

Nginx

wget http://Nginx.org/download/Nginx-1.4.0.tar.gz -> check for latest version on Nginx website tar -xvzf Nginx-1.4.0.tar.gz cd Nginx-1.4.0 ./configure --with-http_flv_module --with-http_ssl_module --with-http_gzip_static_module make sudo make install (uninstall prevIoUs version if Nginx before)

资源

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐