diff --git a/.env b/.env index 17f7ebb68..fbe982494 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ USER=root -PASSWORD=openIM +PASSWORD=openIM123 DATA_DIR=./ \ No newline at end of file diff --git a/config/config.yaml b/config/config.yaml index 08bc152a7..55c939ad2 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -15,7 +15,7 @@ k8sMod: false #开启k8s模式 使用pod里面环境变量请求services调用 mysql: dbMysqlAddress: [ 127.0.0.1:13306 ] #mysql地址 目前仅支持单机,默认即可 dbMysqlUserName: root #mysql用户名,建议修改 - dbMysqlPassword: openIM # mysql密码,建议修改 + dbMysqlPassword: openIM123 # mysql密码,建议修改 dbMysqlDatabaseName: openIM_v2 #默认即可 dbTableName: eMsg #默认即可 dbMsgTableNum: 1 @@ -34,7 +34,7 @@ mongo: dbDatabase: openIM #mongo db 默认即可 dbSource: admin dbUserName: root #mongo用户名,建议先不设置 - dbPassword: openIM #mongo密码,建议先不设置 + dbPassword: openIM123 #mongo密码,建议先不设置 dbMaxPoolSize: 100 dbRetainChatRecords: 3650 #mongo保存离线消息时间(天),根据需求修改 chatRecordsClearTime: "* * * * *" # 每天凌晨3点清除消息,该配置和linux定时任务一样, 清理操作建议设置在用户活跃少的时候 # 0 3 * * * @@ -45,7 +45,7 @@ redis: dbMaxActive: 0 dbIdleTimeout: 120 dbUserName: #only redis version 6.0+ need username - dbPassWord: openIM #redis密码 建议修改 + dbPassWord: openIM123 #redis密码 建议修改 enableCluster: false #如果外部redis以集群方式启动,需要打开此开关 kafka: @@ -125,8 +125,8 @@ credential: #腾讯cos,发送图片、视频、文件时需要,请自行申 endpoint: http://127.0.0.1:10005 #minio外网ip 这个ip是给客户端访问的 endpointInner: http://127.0.0.1:10005 #minio内网地址 如果im server 可以通过内网访问到 minio就可以 endpointInnerEnable: true #是否启用minio内网地址 启用可以让桶初始化,IM server连接minio走内网地址访问 - accessKeyID: user12345 - secretAccessKey: key12345 + accessKeyID: root + secretAccessKey: openIM123 storageTime: 50 #文件在minio中保存的时间 isDistributedMod: false # 是否分布式多硬盘部署 默认docker-compose中为false ali: # ali oss diff --git a/config/open-im-online.conf b/config/open-im-online.conf new file mode 100644 index 000000000..de1d0c56c --- /dev/null +++ b/config/open-im-online.conf @@ -0,0 +1,237 @@ +upstream im_msg_gateway{ + server 127.0.0.1:10001; #指定后端服务器地址 根据部署情况可指定多台 + } +upstream im_api{ + server 127.0.0.1:10002; #指定后端服务器地址 根据部署情况可指定多台 + } +upstream im_jssdk_gateway{ + server 127.0.0.1:10003; #指定后端服务器地址 根据部署情况可指定多台 + } +upstream im_demo{ + server 127.0.0.1:10004; #指定后端服务器地址 根据部署情况可指定多台 + } +upstream im_admin{ + server 127.0.0.1:10006; #指定后端服务器地址 根据部署情况可指定多台 + } +upstream im_grafana{ + server 127.0.0.1:10007; #指定后端服务器地址 docker-compose启动所在机器 + } +upstream im_chat{ + server 127.0.0.1:10008; #指定后端服务器地址 根据部署情况可指定多台 + } +upstream im_complete_admin{ + server 127.0.0.1:10009; #指定后端服务器地址 根据部署情况可指定多台 + } +upstream im_organization{ + server 127.0.0.1:10010; #指定后端服务器地址 根据部署情况可指定多台 + } + +server { + listen 443; + server_name open-im-online.rentsoft.cn; #1 + ssl on; + ssl_certificate /etc/nginx/conf.d/ssl/open-im-online.rentsoft.cn.crt; #2 + ssl_certificate_key /etc/nginx/conf.d/ssl/open-im-online.rentsoft.cn.key; #3 + 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 / { #web demo + 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 /data1/online/Pc-Web-Demo/build/; #4 + index index.html; + try_files $uri $uri/ /index.html; + } + + location /msg_gateway { #10001 ws + 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://im_msg_gateway; + } + + location /api { #10002 api + 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://im_api; + } + + location /jssdk_gateway { #10003 jssdk + 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://im_jssdk_gateway; + } + + location /demo { # 10004 demo + 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://im_demo; + } + + location /admin { #10006 admin + 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://im_admin; + } + location /grafana { #10007 prometheus + 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://im_grafana; + } + location /chat { #10008 chat login + 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://im_chat; + } + location /complete_admin { #10009 admin + 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://im_complete_admin; + } + location /organization { #10010 organization + 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://im_organization; + }//organization +} + + +server { + listen 80; + server_name open-im-online.rentsoft.cn; #1 + rewrite ^(.*)$ https://${server_name}$1 permanent; +} + + + + + + + + +server { + listen 51000; + 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; + + client_max_body_size 200m; + 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://127.0.0.1:8081; + } +} + + +server { + listen 57880; + 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; + + } +} diff --git a/script/.env b/script/.env index 17f7ebb68..fbe982494 100644 --- a/script/.env +++ b/script/.env @@ -1,3 +1,3 @@ USER=root -PASSWORD=openIM +PASSWORD=openIM123 DATA_DIR=./ \ No newline at end of file