I've searched for a whole day, and of course I searched in nodeBB first. But I cannot find a post that solves my problem. So I ask for help here. Please do not mark my post as spam again.
I've read nginx config document, and I've done most of the configs. But it still doesn't work . The queer thing is that it works well in my mac, but it does not work in my server.
My server is CentOS release 6.6 (Final).
And I cannot understand these things:
/path/to/nginx/sites-available/* -- files here must be aliased to ../sites-enabled(my nginx does not have such directory)
/path/to/nginx/conf.d/*.conf -- filenames must end in .conf
/path/to/nginx/httpd.conf -- if all else fails (What does it mean?)
Here is my error informations:
WebSocket connection to 'ws://test1-forum-acp.ezsport.cc/socket.io/?EIO=3&transport=websocket' failed: Error during WebSocket handshake: Unexpected response code: 400
Here is my config:
user nginx;
worker_processes 2;
error_log /mnt/logs/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /mnt/logs/nginx/access.log main;
server_names_hash_bucket_size 64;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
include /etc/nginx1.8/conf/conf.d/*.conf;
}
conf.d/ includes config file blow
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
client_max_body_size 5m;
server_name test1-forum-acp.ezsport.cc;
location / {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://acp_io_nodes;
proxy_redirect off;
# Socket.IO Support
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
upstream acp_io_nodes {
ip_hash;
server 127.0.0.1:5568;
}