序號 東興網(wǎng)站建設公司創(chuàng)新互聯(lián),東興網(wǎng)站設計制作,有大型網(wǎng)站制作公司豐富經(jīng)驗。已為東興成百上千家提供企業(yè)網(wǎng)站建設服務。企業(yè)網(wǎng)站搭建\外貿(mào)網(wǎng)站制作要多少錢,請找那個售后服務好的東興做網(wǎng)站的公司定做! | 資源 | 描述 |
1 | ECS服務器 | 前端服務器 |
2 | 前端服務器 | |
3 | 前端服務器 | |
4 | 后端服務器 | |
5 | 后端服務器 | |
6 | 后端服務器 | |
7 | redis | 數(shù)據(jù)庫,緩存 |
8 | mysql | 數(shù)據(jù)庫 |
9 | clb | 數(shù)據(jù)庫slb,負載均衡 |
10 | OSS | 對象存儲,存儲圖片 |
11 | CDN | CDN加速 |
12 | WAF | WAF防護,Web Application Firewall |
13 | RocketMQ | 消息隊列 |
自動化部署使用Jenkins
Web反向代理使用Nginx
采用springCloud的部署架構(gòu)
配置中心使用Apollo
注冊中心使用Eureka
nginx配置:
主配置nginx.conf
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
client_max_body_size 1024m;
#引入從配置文件
include /etc/nginx/conf.d/*.conf;
server_tokens off;
fastcgi_intercept_errors on;
}
從配置
#常規(guī)服務訪問server
server {
listen 8966;
server_name _;
#代理訪h5靜態(tài)文件
location /h5 {
root /usr/share/nginx/html/;
try_files $uri $uri/ /h5/index.html;
}
#代理訪問后端接口
location /projectApi/ {
proxy_set_header Host $host;
client_max_body_size 10m;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#代理訪問的后端服務
proxy_pass http://localhost:8900/;
}
#代理訪問存放圖片的目錄
location /icon/ {
root /usr/share/nginx/html/icon;
try_files $uri $uri/ /index.html;
}
#代理錯誤頁面訪問
error_page 403 404 /404.html;
location = /404.html {
root error;
}
# redirect server error pages to the static page /50x.html
# error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
#SSl安全訪問服務代理 端口 443
server {
listen 443 ssl;
#域名
server_name maoheyeren.cn;
#安全證書配置
ssl_certificate /etc/nginx/cert/ctg.cn2022.txt;
#安全證書位置
ssl_certificate_key /etc/nginx/cert/private2022_unsecure.key;
ssl_prefer_server_ciphers on;
#安全訪問協(xié)議
ssl_protocols TLSv1.2;
location /h5 {
root /usr/share/nginx/html/;
try_files $uri $uri/ /h5/index.html;
}
location /projectApi/ {
proxy_set_header Host $host;
client_max_body_size 10m;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8900/;
}
location /icon/ {
root /usr/share/nginx/html/icon;
try_files $uri $uri/ /index.html;
}
proxy_intercept_errors on;
error_page 500 502 503 504 404 403 /404.html;
#error_page 500 502 503 504 404 403
location = /404.html {
root /usr/share/nginx/html;
}
# redirect server error pages to the static page /50x.html
# error_page 500 502 503 504 /50x.html;
#location = /50x.html {
# root html;
#}
nginx日志按天分割配置
if ($time_iso8601 ~ "^(d{4})-(d{2})-(d{2})T(d{2}):(d{2}):(d{2})")
{
set $year $1;
set $month $2;
set $day $3;
set $hour $4;
}
access_log /home/docker/apps/nginx/${server_name}_${year}-${month}-${day}_access.log
main;
配置中心APollo
注冊中心Eureka
你是否還在尋找穩(wěn)定的海外服務器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機房具備T級流量清洗系統(tǒng)配攻擊溯源,準確流量調(diào)度確保服務器高可用性,企業(yè)級服務器適合批量采購,新人活動首月15元起,快前往官網(wǎng)查看詳情吧