Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bash
bash
module.exports = {
    port: 3000,
    chat_server_key: "your-chat-server-key",
    secure: true, // use ssl ?
    privateKey: "./private_key.key", // path to private key ?
    cert: "./cert.crt",  // path to cert key ?
    redis: {
        host: 'domain-name127.0.0.1',
        port: 6379
    }
};

Note: In case you are using Nginx server, you can add below configurations to your server instead of updating file config.js as above. Don't forget to update the path for your certificate and private key files. (For many distributions, the file will be located at /etc/nginx/nginx.conf. If it does not exist there, it may also be at /usr/local/nginx/conf/nginx.conf or /usr/local/etc/nginx/nginx.conf)

Code Block
bash
bash
# your SSL configuration
#ssl on;
#ssl_certificate /path/to/ssl_cert.crt;
#ssl_certificate_key /path/to/ssl_private_key.key;

location /socket.io/ {
    # switch off logging
    access_log off;

    # redirect all HTTP traffic to domain-name127.0.0.1:3000
    proxy_pass https://your-domain-name:3000127.0.0.1;
    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";
}

...