欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

非K8S环境下的OpenIM集群部署指南

最编程 2024-07-28 14:17:22
...
upstream msg_gatway_imserver{             server 127.0.0.1:10001;             server 127.0.0.2:10001;           } upstream api_imserver{             server 127.0.0.1:10002;               server 127.0.0.2:10002;           } upstream jssdk_imserver{             server 127.0.0.1:10003;               server 127.0.0.2:10003;           } upstream demo_imserver{             server 127.0.0.1:10004;               server 127.0.0.2:10004;           } upstream cms_imserver{             server 127.0.0.1:10006;               server 127.0.0.2:10006;           } server {       listen 443;       server_name open-im-online.rentsoft.cn;       ssl on;       ssl_certificate /etc/nginx/conf.d/ssl/open-im-online.rentsoft.cn.crt;       ssl_certificate_key /etc/nginx/conf.d/ssl/open-im-online.rentsoft.cn.key;       ssl_session_timeout 5m; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_comp_level 2; gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png; gzip_vary off; gzip_disable "MSIE [1-6]\.";       error_page 405 =200 $uri;       location / {               proxy_set_header Host $host;               proxy_set_header X-Real-Ip $remote_addr;               proxy_set_header X-Forwarded-For $remote_addr;               proxy_set_header X-NginX-Proxy true;               root /data/online/Pc-Web-Demo/build/;               index index.html;               try_files $uri $uri/ /index.html;       } location /admin {               proxy_set_header Host $host;               proxy_set_header X-Real-Ip $remote_addr;               proxy_set_header X-Forwarded-For $remote_addr;               proxy_set_header X-NginX-Proxy true; # root /data/online/Open-IM-Admin/build/; alias /data/online/Open-IM-Admin/build/;               index index.html;               try_files $uri $uri/admin/ /admin/index.html;       } } server {       listen 80;       server_name open-im-online.rentsoft.cn;       rewrite ^(.*)$ https://${server_name}$1 permanent; } server {       listen 10001;       server_name open-im-online.rentsoft.cn;       ssl on;       ssl_certificate /etc/nginx/conf.d/ssl/open-im-online.rentsoft.cn.crt;       ssl_certificate_key /etc/nginx/conf.d/ssl/open-im-online.rentsoft.cn.key;       ssl_session_timeout 5m;       gzip on;       gzip_min_length 1k;       gzip_buffers 4 16k;       gzip_comp_level 2;       gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;       gzip_vary off;       gzip_disable "MSIE [1-6]\.";       location / {               proxy_http_version 1.1;               proxy_set_header Upgrade $http_upgrade;               proxy_set_header Connection "Upgrade";               proxy_set_header X-real-ip $remote_addr;               proxy_set_header X-Forwarded-For $remote_addr;               proxy_pass http://msg_gatway_imserver;           } } server {       listen 10002;       server_name open-im-online.rentsoft.cn;       ssl on;       ssl_certificate /etc/nginx/conf.d/ssl/open-im-online.rentsoft.cn.crt;       ssl_certificate_key /etc/nginx/conf.d/ssl/open-im-online.rentsoft.cn.key;       ssl_session_timeout 5m;       gzip on;       gzip_min_length 1k;       gzip_buffers 4 16k;       gzip_comp_level 2;       gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;       gzip_vary off;       gzip_disable "MSIE [1-6]\.";       location / { proxy_http_version 1.1;               proxy_set_header X-real-ip $remote_addr;               proxy_set_header X-Forwarded-For $remote_addr;               proxy_pass http://api_imserver;       } } server {       listen 10003;       server_name open-im-online.rentsoft.cn;       ssl on;       ssl_certificate /etc/nginx/conf.d/ssl/open-im-online.rentsoft.cn.crt;       ssl_certificate_key /etc/nginx/conf.d/ssl/open-im-online.rentsoft.cn.key;       ssl_session_timeout 5m;       gzip on;       gzip_min_length 1k;       gzip_buffers 4 16k;       gzip_comp_level 2;       gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;       gzip_vary off;       gzip_disable "MSIE [1-6]\.";       location / {               proxy_http_version 1.1;               proxy_set_header Upgrade $http_upgrade;               proxy_set_header Connection "Upgrade";               proxy_set_header X-real-ip $remote_addr;               proxy_set_header X-Forwarded-For $remote_addr;                 proxy_pass http://jssdk_imserver;       } } server {       listen 10004;       server_name open-im-online.rentsoft.cn;       ssl on;       ssl_certificate /etc/nginx/conf.d/ssl/open-im-online.rentsoft.cn.crt;       ssl_certificate_key /etc/nginx/conf.d/ssl/open-im-online.rentsoft.cn.key;       ssl_session_timeout 5m;       gzip on;       gzip_min_length 1k;       gzip_buffers 4 16k;       gzip_comp_level 2;       gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;       gzip_vary off;       gzip_disable "MSIE [1-6]\.";       location / {    proxy_http_version 1.1;               proxy_set_header Upgrade $http_upgrade;               proxy_set_header Connection "Upgrade";               proxy_set_header X-real-ip $remote_addr;               proxy_set_header X-Forwarded-For $remote_addr;               proxy_pass http://demo_imserver;       } } server {       listen 10006;       server_name open-im-online.rentsoft.cn;       ssl on;       ssl_certificate /etc/nginx/conf.d/ssl/open-im-online.rentsoft.cn.crt;       ssl_certificate_key /etc/nginx/conf.d/ssl/open-im-online.rentsoft.cn.key;       ssl_session_timeout 5m;       gzip on;       gzip_min_length 1k;       gzip_buffers 4 16k;       gzip_comp_level 2;       gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;       gzip_vary off;       gzip_disable "MSIE [1-6]\.";       location / {    proxy_http_version 1.1;               proxy_set_header X-real-ip $remote_addr;               proxy_set_header X-Forwarded-For $remote_addr;               proxy_pass http://cms_imserver;       } } server {       listen 7880;       server_name open-im-online.rentsoft.cn;       ssl on;       ssl_certificate /etc/nginx/conf.d/ssl/open-im-online.rentsoft.cn.crt;       ssl_certificate_key /etc/nginx/conf.d/ssl/open-im-online.rentsoft.cn.key;       ssl_session_timeout 5m;       gzip on;       gzip_min_length 1k;       gzip_buffers 4 16k;       gzip_comp_level 2;       gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;       gzip_vary off;       gzip_disable "MSIE [1-6]\.";       location / {               proxy_http_version 1.1;               proxy_set_header Upgrade $http_upgrade;               proxy_set_header Connection "Upgrade";               proxy_set_header X-real-ip $remote_addr;               proxy_set_header X-Forwarded-For $remote_addr;               proxy_pass http://127.0.0.1:7880;       } } upstream storage {   server 127.0.0.1:10005; } server { #     listen 443;   #     server_name storage-online.rentsoft.cn;   #   ssl on     #   ssl_certificate /etc/nginx/conf.d/ssl/storage-online.rentsoft.cn_bundle.crt;     # ssl_certificate_key /etc/nginx/conf.d/ssl/storage-online.rentsoft.cn.key;       ssl_session_timeout 5m; listen 443;       server_name storage-online.rentsoft.cn;       ssl on;       ssl_certificate /etc/nginx/conf.d/ssl/storage-online.rentsoft.cn_nginx/storage-online.rentsoft.cn_bundle.crt;       ssl_certificate_key /etc/nginx/conf.d/ssl/storage-online.rentsoft.cn_nginx/storage-online.rentsoft.cn.key;       gzip on;       gzip_min_length 1k;       gzip_buffers 4 16k;       gzip_comp_level 2;       gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;       gzip_vary off;       gzip_disable "MSIE [1-6]\.";   location / {           proxy_pass http://127.0.0.1:10005/;           proxy_set_header X-Real-IP $remote_addr;           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;           proxy_set_header X-Forwarded-Proto $scheme;           proxy_set_header Host $http_host;           proxy_http_version 1.1;           client_max_body_size 8000M;   } }

推荐阅读