Comments (3)
The following is my nginx configuration
upstream b888 {
server 127.0.0.1:8888;
}
upstream b443 {
server 127.0.0.1:8443;
}
upstream b889 {
server 127.0.0.1:8889;
}
server
{
listen 443;
server_name w.cc;
large_client_header_buffers 8 32k;
ssl on;
ssl_certificate /Users/chjade/w.cc.cert;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
ssl_certificate_key /Users/chjade/w.cc.key;
root /Users/chjade/htdocs/wrtc_start/public;
index index.php index.html index.htm;
set $flag 0;
if ($request_uri !~* "/socket.io/")
{
set $flag "${flag}1";
}
if ($request_uri !~* "/channel/")
{
set $flag "${flag}2";
}
if ($request_uri !~* "/ws/buffalo")
{
set $flag "${flag}3";
}
location /ws/buffalo {
access_log off;
proxy_pass http://b889;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# WebSocket support (nginx 1.4)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Path rewriting
rewrite /ws/buffalo/(.*) /$1 break;
proxy_redirect off;
}
location /socket.io/
{
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
# prevents 502 bad gateway error
proxy_buffers 8 32k;
proxy_buffer_size 64k;
proxy_pass https://b443;
proxy_redirect off;
# enables WS support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
break;
}
location /channel
{
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
# prevents 502 bad gateway error
proxy_buffers 8 32k;
proxy_buffer_size 64k;
proxy_pass https://b443;
proxy_redirect off;
# enables WS support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
rewrite /channel/(.*) /$1;
break;
}
if (!-e $request_filename) {
set $flag "${flag}4";
}
if ($flag = '01234') {
rewrite ^/(.*) /index.php/$1 last;
}
location ~ ^.+\.php {
root /Users/chjade/htdocs/wrtc_start/public;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_pass 127.0.0.1:9001;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME /Users/chjade/htdocs/wrtc_start/public$fastcgi_script_name;
fastcgi_param PATH_TRANSLATED /Users/chjade/htdocs/wrtc_start/public$fastcgi_path_info;
include fastcgi.conf;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
}
from elephant.io.
Could you test on the master branch ? Thanks
from elephant.io.
As there are no response, closing this ticket (especially as the legacy branch is not really supported anymore)
from elephant.io.
Related Issues (20)
- SSL routines:SSL_write:protocol is shutdown HOT 7
- In Version1X.php line 194: Notice: Undefined index: upgrades HOT 8
- Set headers over SSL HOT 2
- readBytes while when fread return empty string
- Read and emit message from php HOT 1
- Path in socket connection HOT 1
- Get Session for distribute login user data?
- Slowness issue HOT 1
- oncesk/elephant.io for php7 HOT 1
- socket.io 3 HOT 9
- connect to socket io of ws://
- connection event not being called HOT 2
- An error occurred while trying to establish a connection to the server HOT 4
- Is Elephant.io can be used to connect through websocket?
- elephant.io is 100% down hard. HOT 1
- Fatao Error: ServerConnectionFailureException HOT 2
- did someone tried to use it with socket.io version 4x ? HOT 1
- suddenly can't establish connection with server HOT 4
- Using Version2X but getting a Version1X error ? HOT 4
- UnexpectedValueException "The server returned an unexpected value. Expected "HTTP/1.1 101", had "HTTP/1.1 400"" #217 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elephant.io.