VoceChat is a chat platform developed by Chinese people. It is lightweight (about 15M) and can be built on its own server (or local). It is a cross platform client. If necessary, the partners can install and run tests. The official provides two installation modes: Shell+Docker. If you want to experience quickly, you can choose Docker+Nginx (as shown below)
VoceChat installation method: Docker+Nginx mode
The following is excerpted from the official website: https://vocechat-doc.vercel.app/zh-cn/install/install-by-docker
① Run Vocechat under Docker (take the domain name chat.vmvps.com as an example)
docker run -d --restart=always \ -p 3009:3000 \ --name vocechat-server \ -v ~/.vocechat-server/data:/home/vocechat-server/data \ privoce/vocechat-server:latest \ --network.frontend_url " https://chat.vmvps.com "
② Modify Nginx configuration
The Nginx configuration file directory is generally in/etc/nginx/conf.d. Create a new Nginx configuration file chat.vmvps.com.conf, and configure the corresponding http request:
server{ server_name chat.vmvps.com; location / { proxy_pass http://127.0.0.1:3009 ; # The port number here depends on the external port number of the Docker proxy_redirect off; 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_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_max_temp_file_size 0; # Turn off the hard disk cache and increase the write speed #SSE related configuration proxy_http_version 1.1; proxy_set_header Connection ''; } }
③ Run Vocechat initialization configuration
Nginx - t # Test whether Nginx configuration is correct Nginx - s reload # Overload Nginx configuration
Browser Access http://chat.vmvps.com (Note that the domain name DNS is resolved to your server in advance) The configuration is successful when you enter the initialization page.
④ Set the security certificate to implement HTTPS (take Cetrbot as an example)
1. Install Certbot (official website: https://certbot.eff.org/instructions Select the corresponding version to download)
2. Run Certbot to automatically read the configuration Nginx
sudo certbot certonly --nginx
Nginx configuration will become
server{ server_name chat.vmvps.com; location / { proxy_pass http://127.0.0.1:3009 ; # The port number here depends on the external port number of the Docker proxy_redirect off; 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_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_max_temp_file_size 0; # Turn off the hard disk cache and increase the write speed #SSE related configuration proxy_http_version 1.1; proxy_set_header Connection ''; } listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/chat.vmvps.com/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/chat.vmvps.com/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot } server{ if ($host = chat.vmvps.com) { return 301 https://$host$request_uri; } # managed by Certbot listen 80; server_name chat.vmvps.com; return 404; # managed by Certbot }
Overload Nginx configuration
nginx -s reload
Browser Access http://chat.vmvps.com Automatically switch to https protocol
The post #Self built # VoceChat: self built chat platform appeared first on Micro Demon Tribe .
]]>