初始化提交
This commit is contained in:
190
nginx/大推线上最新相关配置/app.lessie.ai.conf
Normal file
190
nginx/大推线上最新相关配置/app.lessie.ai.conf
Normal file
@@ -0,0 +1,190 @@
|
||||
# ===========全硅谷区===============
|
||||
upstream app_lessie_ai_backend {
|
||||
ip_hash;
|
||||
server 10.0.0.12:7001 weight=10 max_fails=3 fail_timeout=30s;
|
||||
server 10.0.0.7:7001 weight=10 max_fails=3 fail_timeout=30s;
|
||||
server 10.0.0.11:7001 weight=10 max_fails=3 fail_timeout=30s;
|
||||
server 10.0.0.2:7001 weight=10 max_fails=3 fail_timeout=30s;
|
||||
server 10.0.0.13:7001 weight=10 max_fails=3 fail_timeout=30s;
|
||||
}
|
||||
|
||||
upstream go_backend {
|
||||
ip_hash;
|
||||
server 10.0.0.10:8100 weight=10 max_fails=3 fail_timeout=30s;
|
||||
server 10.0.0.8:8100 weight=10 max_fails=3 fail_timeout=30s;
|
||||
}
|
||||
|
||||
upstream java_agent_backend {
|
||||
server 10.0.0.10:8070 weight=10 max_fails=3 fail_timeout=30s;
|
||||
server 10.0.0.8:8070 weight=10 max_fails=3 fail_timeout=30s;
|
||||
}
|
||||
|
||||
log_format app_lessie_ai_log '客户端IP: $remote_addr | 用户: $remote_user | 时间: $time_local | '
|
||||
'请求方法和路径: "$request" | 状态码: $status | 响应大小: $body_bytes_sent | '
|
||||
'来源页面: "$http_referer" | 客户端UA: "$http_user_agent" | '
|
||||
'上游服务器: $upstream_addr | 上游响应耗时: $upstream_response_time | '
|
||||
'请求总耗时: $request_time | Host: $host';
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name app.lessie.ai;
|
||||
|
||||
ssl_certificate /data/tengine/certificate/lessie.ai.pem;
|
||||
ssl_certificate_key /data/tengine/certificate/lessie.ai.key;
|
||||
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
# 单独日志文件
|
||||
access_log /data/tengine/logs/app_lessie_ai_access.log app_lessie_ai_log;
|
||||
error_log /data/tengine/logs/app_lessie_ai_error.log;
|
||||
|
||||
# 前端静态文件
|
||||
location / {
|
||||
root /data/tengine/html/app.lessie_ai_agent/dist/;
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# 精确匹配 index.html,禁用缓存
|
||||
location = /index.html {
|
||||
root /data/tengine/html/app.lessie_ai_agent/dist/;
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
}
|
||||
# 静态资源开启长缓存(带 hash)
|
||||
location ~* \.(js|css|woff2|json|svg|png|jpg|jpeg|gif|ico|ttf|otf|eot|mp4|webm|webp)$ {
|
||||
root /data/tengine/html/app.lessie_ai_agent/dist/;
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
}
|
||||
|
||||
|
||||
# go中转服务
|
||||
location ~ ^/(debug/pprof|api/chat/.*|api/conversation/.*|api/shares.*|api/showcases.*|api/searches.*) {
|
||||
# location ~ ^/(debug/pprof|api/chat|api/conversation|api/shares|api/showcases|api/searches) {
|
||||
proxy_pass http://go_backend;
|
||||
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_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
proxy_request_buffering off;
|
||||
|
||||
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
|
||||
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,X-Requested-With,Accept,Origin' always;
|
||||
|
||||
proxy_read_timeout 2000s;
|
||||
proxy_send_timeout 2000s;
|
||||
|
||||
if ($request_method = OPTIONS ) {
|
||||
return 204;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# python对话接口
|
||||
location /api/chat/stream {
|
||||
proxy_pass http://app_lessie_ai_backend;
|
||||
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_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
proxy_request_buffering off;
|
||||
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
|
||||
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,X-Requested-With,Accept,Origin' always;
|
||||
# 增加客户端到Nginx的连接超时时间
|
||||
proxy_read_timeout 1000s;
|
||||
proxy_send_timeout 1000s;
|
||||
if ($request_method = OPTIONS ) {
|
||||
return 204;
|
||||
}
|
||||
}
|
||||
|
||||
# python其它接口
|
||||
location /api/ {
|
||||
proxy_pass http://app_lessie_ai_backend;
|
||||
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_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
proxy_request_buffering off;
|
||||
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
|
||||
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,X-Requested-With,Accept,Origin' always;
|
||||
if ($request_method = OPTIONS ) {
|
||||
return 204;
|
||||
}
|
||||
}
|
||||
|
||||
# 打到国内prod的agent.jar包
|
||||
location /prod-api/agent/ {
|
||||
proxy_pass http://java_agent_backend;
|
||||
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_intercept_errors off;
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_set_header Connection keep-alive;
|
||||
|
||||
client_max_body_size 300M;
|
||||
|
||||
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
|
||||
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,X-Requested-With,Accept,Origin' always;
|
||||
|
||||
if ($request_method = OPTIONS ) {
|
||||
return 204;
|
||||
}
|
||||
}
|
||||
# 打到国内prod的agent.jar包
|
||||
location /prod-api/system {
|
||||
proxy_pass http://java_agent_backend;
|
||||
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_intercept_errors off;
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_set_header Connection keep-alive;
|
||||
client_max_body_size 300M;
|
||||
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
|
||||
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,X-Requested-With,Accept,Origin' always;
|
||||
if ($request_method = OPTIONS ) {
|
||||
return 204;
|
||||
}
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root html;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name app.lessie.ai;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
# ===========全硅谷区===============
|
||||
|
||||
42
nginx/大推线上最新相关配置/go_prod_lessie_sourcing_api.conf
Normal file
42
nginx/大推线上最新相关配置/go_prod_lessie_sourcing_api.conf
Normal file
@@ -0,0 +1,42 @@
|
||||
upstream againjar_to_go {
|
||||
ip_hash;
|
||||
server 10.0.0.10:8100 weight=10 max_fails=3 fail_timeout=30s;
|
||||
server 10.0.0.8:8100 weight=10 max_fails=3 fail_timeout=30s;
|
||||
}
|
||||
|
||||
log_format againjar_to_go_log '客户端IP: $remote_addr | 用户: $remote_user | 时间: $time_local | '
|
||||
'请求方法和路径: "$request" | 状态码: $status | 响应大小: $body_bytes_sent | '
|
||||
'来源页面: "$http_referer" | 客户端UA: "$http_user_agent" | '
|
||||
'上游服务器: $upstream_addr | 上游响应耗时: $upstream_response_time | '
|
||||
'请求总耗时: $request_time | Host: $host';
|
||||
|
||||
server{
|
||||
listen 50401;
|
||||
server_name _;
|
||||
|
||||
access_log /data/tengine/logs/agentjar_to_go_access.log againjar_to_go_log;
|
||||
error_log /data/tengine/logs/agentjar_to_go_error.log;
|
||||
|
||||
|
||||
location / {
|
||||
proxy_pass http://againjar_to_go;
|
||||
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_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
|
||||
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
|
||||
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,X-Requested-With,Accept,Origin' always;
|
||||
|
||||
if ($request_method = OPTIONS ) {
|
||||
return 204;
|
||||
}
|
||||
}
|
||||
}
|
||||
42
nginx/大推线上最新相关配置/java_prod_agent_ip.conf
Normal file
42
nginx/大推线上最新相关配置/java_prod_agent_ip.conf
Normal file
@@ -0,0 +1,42 @@
|
||||
upstream prod_java_search {
|
||||
ip_hash;
|
||||
server 10.0.0.10:8070 weight=10 max_fails=3 fail_timeout=30s;
|
||||
server 10.0.0.8:8070 weight=10 max_fails=3 fail_timeout=30s;
|
||||
}
|
||||
|
||||
log_format prod_java_search_log '客户端IP: $remote_addr | 用户: $remote_user | 时间: $time_local | '
|
||||
'请求方法和路径: "$request" | 状态码: $status | 响应大小: $body_bytes_sent | '
|
||||
'来源页面: "$http_referer" | 客户端UA: "$http_user_agent" | '
|
||||
'上游服务器: $upstream_addr | 上游响应耗时: $upstream_response_time | '
|
||||
'请求总耗时: $request_time | Host: $host';
|
||||
|
||||
server{
|
||||
listen 50301;
|
||||
server_name _;
|
||||
|
||||
access_log /data/tengine/logs/java_prod_agent_ip_access.log prod_java_search_log;
|
||||
error_log /data/tengine/logs/java_prod_agent_ip_error.log;
|
||||
|
||||
|
||||
location / {
|
||||
proxy_pass http://prod_java_search;
|
||||
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_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
|
||||
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
|
||||
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,X-Requested-With,Accept,Origin' always;
|
||||
|
||||
if ($request_method = OPTIONS ) {
|
||||
return 204;
|
||||
}
|
||||
}
|
||||
}
|
||||
46
nginx/大推线上最新相关配置/python_prod_agent_ip.conf
Normal file
46
nginx/大推线上最新相关配置/python_prod_agent_ip.conf
Normal file
@@ -0,0 +1,46 @@
|
||||
upstream prod_py_search {
|
||||
# ip_hash;
|
||||
hash $http_user_id consistent;
|
||||
server 10.0.0.13:7001 weight=10 max_fails=3 fail_timeout=30s;
|
||||
server 10.0.0.12:7001 weight=10 max_fails=3 fail_timeout=30s;
|
||||
server 10.0.0.7:7001 weight=10 max_fails=3 fail_timeout=30s;
|
||||
server 10.0.0.11:7001 weight=10 max_fails=3 fail_timeout=30s;
|
||||
server 10.0.0.2:7001 weight=10 max_fails=3 fail_timeout=30s;
|
||||
}
|
||||
|
||||
log_format prod_py_search_log '时间: $time_local | 客户端IP: $remote_addr |'
|
||||
'请求方法和路径: "$request" | 状态码: $status | 响应大小: $body_bytes_sent | '
|
||||
'UserID: "$http_user_id" | 客户端UA: "$http_user_agent" | '
|
||||
'上游服务器: $upstream_addr | 上游响应耗时: $upstream_response_time | '
|
||||
'请求总耗时: $request_time | Host: $host';
|
||||
|
||||
server{
|
||||
listen 50201;
|
||||
server_name _;
|
||||
|
||||
access_log /data/tengine/logs/python_prod_agent_ip_access.log prod_py_search_log;
|
||||
error_log /data/tengine/logs/python_prod_agent_ip_error.log;
|
||||
|
||||
|
||||
location / {
|
||||
proxy_pass http://prod_py_search;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
|
||||
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
|
||||
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,X-Requested-With,Accept,Origin' always;
|
||||
|
||||
if ($request_method = OPTIONS ) {
|
||||
return 204;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user