swarm
This commit is contained in:
@ -5,11 +5,17 @@ networks:
|
||||
name: ${NAMESPACE}
|
||||
external: true
|
||||
services:
|
||||
server:
|
||||
server1:
|
||||
image: 'docker.io/bitnami/nginx:1.24'
|
||||
ports:
|
||||
- '8080:8080'
|
||||
- '8443:8443'
|
||||
- mode: host
|
||||
protocol: tcp
|
||||
published: 8180
|
||||
target: 8080
|
||||
- mode: host
|
||||
protocol: tcp
|
||||
published: 8143
|
||||
target: 8443
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
volumes:
|
||||
@ -25,19 +31,50 @@ services:
|
||||
target: /opt/bitnami/nginx/conf/server_blocks/sinoassist.com.pem
|
||||
- source: nginx_prod_config
|
||||
target: /opt/bitnami/nginx/conf/server_blocks/prod.conf
|
||||
- source: nginx_prod_sup_config
|
||||
target: /opt/bitnami/nginx/conf/server_blocks/prod-sup.conf
|
||||
- source: nginx_other_config
|
||||
target: /opt/bitnami/nginx/conf/server_blocks/zd-other.conf
|
||||
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 2
|
||||
replicas: 1
|
||||
update_config:
|
||||
order: start-first
|
||||
placement:
|
||||
constraints:
|
||||
- node.labels.${NAMESPACE}_nginx==1
|
||||
- node.hostname==ZD-CRM1
|
||||
server2:
|
||||
image: 'docker.io/bitnami/nginx:1.24'
|
||||
ports:
|
||||
- mode: host
|
||||
protocol: tcp
|
||||
published: 8280
|
||||
target: 8080
|
||||
- mode: host
|
||||
protocol: tcp
|
||||
published: 8243
|
||||
target: 8443
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
volumes:
|
||||
- /opt/logs/nginx/:/opt/bitnami/nginx/logs/
|
||||
configs:
|
||||
- source: nginx_conf
|
||||
target: /opt/bitnami/nginx/conf/nginx.conf
|
||||
- source: nginx_ssl_sinoassist_config
|
||||
target: /opt/bitnami/nginx/conf/ssl.sinoassist.conf
|
||||
- source: ssl_sinoassist_key
|
||||
target: /opt/bitnami/nginx/conf/server_blocks/sinoassist.com.key
|
||||
- source: ssl_sinoassist_pem
|
||||
target: /opt/bitnami/nginx/conf/server_blocks/sinoassist.com.pem
|
||||
- source: nginx_prod_config
|
||||
target: /opt/bitnami/nginx/conf/server_blocks/prod.conf
|
||||
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
update_config:
|
||||
order: start-first
|
||||
placement:
|
||||
constraints:
|
||||
- node.hostname==ZD-CRM2
|
||||
configs:
|
||||
nginx_conf:
|
||||
external: true
|
||||
@ -47,13 +84,7 @@ configs:
|
||||
name: nginx_ssl_sinoassist_conf_v1
|
||||
nginx_prod_config:
|
||||
external: true
|
||||
name: nginx_prod_config_v1
|
||||
nginx_prod_sup_config:
|
||||
external: true
|
||||
name: nginx_prod_sup_config_v1
|
||||
nginx_other_config:
|
||||
external: true
|
||||
name: nginx_other_config_v1
|
||||
name: nginx_prod_config_v2
|
||||
ssl_sinoassist_key:
|
||||
external: true
|
||||
name: ssl_sinoassist_key_2024
|
||||
|
@ -1,44 +0,0 @@
|
||||
## 公司其他域名的切换
|
||||
|
||||
# 4s店微信
|
||||
server {
|
||||
listen 8080;
|
||||
server_name wx4s.sinoassist.com;
|
||||
|
||||
location / {
|
||||
proxy_pass http://192.168.10.7:8777;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# 微信供应商
|
||||
server {
|
||||
listen 8080;
|
||||
server_name wxdd.sinoassist.com;
|
||||
|
||||
location / {
|
||||
proxy_pass http://192.168.10.7:8568;
|
||||
}
|
||||
}
|
||||
|
||||
# 呼叫中心接口
|
||||
server {
|
||||
listen 8080;
|
||||
server_name apicc.sinoassist.com;
|
||||
include /opt/bitnami/nginx/conf/ssl.sinoassist.conf;
|
||||
|
||||
location / {
|
||||
proxy_pass http://192.168.5.201:8080;
|
||||
}
|
||||
}
|
||||
|
||||
# 呼叫中心接口websocket
|
||||
server {
|
||||
listen 8080;
|
||||
server_name apiccws.sinoassist.com;
|
||||
include /opt/bitnami/nginx/conf/ssl.sinoassist.conf;
|
||||
|
||||
location / {
|
||||
proxy_pass http://192.168.5.201:1884;
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
|
||||
#### 中道prod环境开始 ####
|
||||
|
||||
upstream api.zhongdao {
|
||||
server ss52_sa-gateway_svc:8080;
|
||||
@ -164,4 +165,118 @@ server {
|
||||
add_header Strict-Transport-Security max-age=15768000;
|
||||
return 301 https://www.sinoassist.com$request_uri;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#### 中道prod环境结束 ####
|
||||
|
||||
## 公司其他域名的切换
|
||||
|
||||
# 4s店微信
|
||||
server {
|
||||
listen 8080;
|
||||
server_name wx4s.sinoassist.com;
|
||||
|
||||
location / {
|
||||
proxy_pass http://192.168.10.7:8777;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# 微信供应商
|
||||
server {
|
||||
listen 8080;
|
||||
server_name wxdd.sinoassist.com;
|
||||
|
||||
location / {
|
||||
proxy_pass http://192.168.10.7:8568;
|
||||
}
|
||||
}
|
||||
|
||||
# 呼叫中心接口
|
||||
server {
|
||||
listen 8080;
|
||||
server_name apicc.sinoassist.com;
|
||||
include /opt/bitnami/nginx/conf/ssl.sinoassist.conf;
|
||||
|
||||
location / {
|
||||
proxy_pass http://192.168.5.201:8080;
|
||||
}
|
||||
}
|
||||
|
||||
# 呼叫中心接口websocket
|
||||
server {
|
||||
listen 8080;
|
||||
server_name apiccws.sinoassist.com;
|
||||
include /opt/bitnami/nginx/conf/ssl.sinoassist.conf;
|
||||
|
||||
location / {
|
||||
proxy_pass http://192.168.5.201:1884;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
## 救援生产环境其他服务域名切换
|
||||
|
||||
|
||||
## rabbitmq stomp
|
||||
upstream stomp.zhongdao {
|
||||
server prod_rabbitmq_queue1:15674;
|
||||
server prod_rabbitmq_queue2:15674;
|
||||
server prod_rabbitmq_stats:15674;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 8080;
|
||||
include /opt/bitnami/nginx/conf/ssl.sinoassist.conf;
|
||||
server_name stomp.sinoassist.com;
|
||||
|
||||
location / {
|
||||
proxy_pass http://stomp.zhongdao;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# 备份文件服务器
|
||||
server {
|
||||
listen 8080;
|
||||
server_name file.sinoassist.com;
|
||||
include /opt/bitnami/nginx/conf/ssl.sinoassist.conf;
|
||||
|
||||
# 录音文件服务器
|
||||
location /ly/ {
|
||||
proxy_pass http://192.168.5.204:8088/;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-Host $server_name;
|
||||
proxy_set_header X-Forwarded-For
|
||||
$proxy_add_x_forwarded_for;
|
||||
if ($request_filename ~ .*\.(htm|html)$)
|
||||
{
|
||||
add_header Cache-Control no-cache;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# 备份文件服务器
|
||||
location / {
|
||||
proxy_pass http://192.168.10.18:8888;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-Host $server_name;
|
||||
proxy_set_header X-Forwarded-For
|
||||
$proxy_add_x_forwarded_for;
|
||||
if ($request_filename ~ .*\.(htm|html)$)
|
||||
{
|
||||
add_header Cache-Control no-cache;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,65 +0,0 @@
|
||||
## 救援生产环境其他服务域名切换
|
||||
|
||||
|
||||
## rabbitmq stomp
|
||||
upstream stomp.zhongdao {
|
||||
server prod_rabbitmq_queue1:15674;
|
||||
server prod_rabbitmq_queue2:15674;
|
||||
server prod_rabbitmq_stats:15674;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 8080;
|
||||
include /opt/bitnami/nginx/conf/ssl.sinoassist.conf;
|
||||
server_name stomp.sinoassist.com;
|
||||
|
||||
location / {
|
||||
proxy_pass http://stomp.zhongdao;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# 备份文件服务器
|
||||
server {
|
||||
listen 8080;
|
||||
server_name file.sinoassist.com;
|
||||
include /opt/bitnami/nginx/conf/ssl.sinoassist.conf;
|
||||
|
||||
# 录音文件服务器
|
||||
location /ly/ {
|
||||
proxy_pass http://192.168.5.204:8088/;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-Host $server_name;
|
||||
proxy_set_header X-Forwarded-For
|
||||
$proxy_add_x_forwarded_for;
|
||||
if ($request_filename ~ .*\.(htm|html)$)
|
||||
{
|
||||
add_header Cache-Control no-cache;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# 备份文件服务器
|
||||
location / {
|
||||
proxy_pass http://192.168.10.18:8888;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-Host $server_name;
|
||||
proxy_set_header X-Forwarded-For
|
||||
$proxy_add_x_forwarded_for;
|
||||
if ($request_filename ~ .*\.(htm|html)$)
|
||||
{
|
||||
add_header Cache-Control no-cache;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user