当前位置:网站首页>Configure load balancing
Configure load balancing
2022-07-01 09:37:00 【tjg888888】
Front end project domain name profile
upstream backendapi {
#ip_hash;
server stg_api2.vfinemusic.com:8081;
server bro_api2.vfinemusic.com:8080;
}
server {
listen 80;
client_max_body_size 10240M;
server_name stg_broadmin.vfinemusic.com;
access_log /data/logs/nginx/access_nginx.log combined;
error_log /data/logs/nginx/error_nginx.log;
set $root_path '/www/bro-admin/admin-system/admin/dist';
root $root_path;
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php {
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index /index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
location ~ /\.ht {
deny all;
}
location / {
try_files $uri $uri/ /index.html;
}
location /api/ {
proxy_pass http://broapi.vfinemusic.com/;
}
}
server {
listen 443 ssl;
client_max_body_size 10240M;
server_name stg_broadmin.vfinemusic.com;
access_log /data/logs/nginx/access_nginx.log combined;
error_log /data/logs/nginx/error_nginx.log;
set $root_path '/www/bro-admin/admin-system/admin/dist';
root $root_path;
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
ssl_certificate /usr/local/openresty/nginx/ssl/vfinemusic.cer;
ssl_certificate_key /usr/local/openresty/nginx/ssl/vfinemusic.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_session_cache builtin:1000 shared:SSL:10m;
# openssl dhparam -out /usr/local/nginx/conf/ssl/dhparam.pem 2048
# ssl_dhparam /usr/local/nginx/conf/ssl/dhparam.pem;
location ~ \.php {
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index /index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
location ~ /\.ht {
deny all;
}
location / {
try_files $uri $uri/ /index.html;
}
location /api/ {
# proxy_pass https://broapi.vfinemusic.com/;
proxy_pass http://backendapi/;
}
}
stg_api2.vfinemusic.com Domain name profile content
server {
listen 8081;
server_name stg_api2.vfinemusic.com;
access_log /data/logs/nginx/access_nginx.log combined;
error_log /data/logs/nginx/error_nginx.log;
set $root_path '/www/bro-api/public';
root $root_path;
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php {
fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index /index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
location ~ /\.ht {
deny all;
}
}
#server {
# listen 443 ssl;
# server_name stg_api2.vfinemusic.com;
# ssl_certificate /usr/local/openresty/nginx/ssl/vfinemusic.cer;
# ssl_certificate_key /usr/local/openresty/nginx/ssl/vfinemusic.key;
# ssl_session_timeout 5m;
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
# ssl_prefer_server_ciphers on;
# ssl_session_cache builtin:1000 shared:SSL:10m;
# access_log /data/logs/nginx/access_nginx.log combined;
# error_log /data/logs/nginx/error_nginx.log;
# set $root_path '/www/bro-api/public';
# root $root_path;
# index index.php index.html index.htm;
# try_files $uri $uri/ @rewrite;
# location @rewrite {
# rewrite ^/(.*)$ /index.php?_url=/$1;
# }
# location ~ \.php {
# fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/dev/shm/php-cgi.sock;
# fastcgi_index /index.php;
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# fastcgi_param PATH_INFO $fastcgi_path_info;
# fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# include fastcgi_params;
# }
# location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
# root $root_path;
# }
# location ~ /\.ht {
# deny all;
# }
# location ~ ^/php-fpm_status$ {
# fastcgi_pass unix:/dev/shm/php-cgi.sock;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi.conf;
# }
# }
bro_api2.vfinemusic.com Domain name profile content
server {
listen 8080;
server_name bro_api2.vfinemusic.com;
access_log /data/logs/nginx/access_nginx.log combined;
error_log /data/logs/nginx/error_nginx.log;
set $root_path '/www/bro-api/public';
root $root_path;
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php {
fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index /index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
location ~ /\.ht {
deny all;
}
}
#server {
# listen 443 ssl;
# server_name stg_api2.vfinemusic.com;
# ssl_certificate /usr/local/openresty/nginx/ssl/vfinemusic.cer;
# ssl_certificate_key /usr/local/openresty/nginx/ssl/vfinemusic.key;
# ssl_session_timeout 5m;
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
# ssl_prefer_server_ciphers on;
# ssl_session_cache builtin:1000 shared:SSL:10m;
# access_log /data/logs/nginx/access_nginx.log combined;
# error_log /data/logs/nginx/error_nginx.log;
# set $root_path '/www/bro-api/public';
# root $root_path;
# index index.php index.html index.htm;
# try_files $uri $uri/ @rewrite;
# location @rewrite {
# rewrite ^/(.*)$ /index.php?_url=/$1;
# }
# location ~ \.php {
# fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/dev/shm/php-cgi.sock;
# fastcgi_index /index.php;
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# fastcgi_param PATH_INFO $fastcgi_path_info;
# fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# include fastcgi_params;
# }
# location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
# root $root_path;
# }
# location ~ /\.ht {
# deny all;
# }
# location ~ ^/php-fpm_status$ {
# fastcgi_pass unix:/dev/shm/php-cgi.sock;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi.conf;
# }
# }
边栏推荐
猜你喜欢
随机推荐
LeetCode 344. Reverse string
[pytorch] softmax function
[ESP nanny level tutorial] crazy completion chapter - Case: chemical environment system detection based on Alibaba cloud and Arduino, supporting nail robot alarm
HMS core audio editing service 3D audio technology helps create an immersive auditory feast
华为帐号多端协同,打造美好互联生活
PR training notes
nacos簡易實現負載均衡
樹結構---二叉樹2非遞歸遍曆
js原型继承仅可继承实例而非构造器
MapReduce programming basics
闭包实现迭代器效果
PHP array functions (merge, split, append, find, delete, etc.)
js重写自己的函数
121. thread scheduling: join() method and yield() method
Wechat applet WebView prohibits page scrolling without affecting the implementation of overflow scrolling in the business
Closure implementation iterator effect
ES6 const essence and completely immutable implementation (object.free)
【检测技术课案】简易数显电子秤的设计与制作
[pytorch learning] torch device
Differences between JS valueof and toString








