JAVA开发运维(基于腾讯云的运维资源)

序号

资源

描述

1

ECS服务器

前端服务器

2

前端服务器

3

前端服务器

4

后端服务器

5

后端服务器

6

后端服务器

7

redis

数据库,缓存

8

mysql

数据库

9

clb

数据库slb,负载均衡

10

OSS

对象存储,存储图片

11

CDN

CDN加速

12

WAF

WAF防护,Web Application Firewall

13

RocketMQ

消息队列

自动化部署使用Jenkins

Web反向代理使用Nginx

采用springCloud的部署架构

配置中心使用Apollo

注册中心使用Eureka

JAVA开发运维(基于腾讯云的运维资源)_第1张图片

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;
}

从配置

#常规服务访问server
server {
    listen 8966;
    server_name _;
     
     #代理访h5静态文件
     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;
    #安全访问协议
    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

JAVA开发运维(基于腾讯云的运维资源)_第2张图片

注册中心Eureka

JAVA开发运维(基于腾讯云的运维资源)_第3张图片

你可能感兴趣的:(java,运维,腾讯云,数据库)