加入收藏 | 设为首页 | 会员中心 | 我要投稿 晋中站长网 (https://www.0354zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > 建站资源 > 优化 > 正文

基于 Spring Cloud 与 Vue.js 的前后端一站式部署

发布时间:2019-11-04 15:20:38 所属栏目:优化 来源:老马
导读:本文将带大家从一台全新的 CentOS 服务器开始,部署一套完整的前后端分离项目。操作步骤非常详细,新手友好型文章~ 后端技术栈:Spring Cloud 微服务架构 + Redis + RabbitMQ + MySQL; 前端技术栈:Vue + ElementUI; 部署工具:后端用 Docker 容器化部署,

先下载安装基础库:

  1. yum -y install gcc gcc-c++ autoconf pcre pcre-devel make automake 
  2. yum -y install wget httpd-tools vim 

安装 Nginx:

  1. sudo yum install nginx 

配置 Nginx

Nginx 的配置文件目录:

Nginx 主配置文件:

  1. Nginx 主配置文件: 
  2. /etc/nginx/nginx.conf 
  3. /etc/nginx 
  4. /etc/nginx/conf.d 
  5. /etc/nginx/conf.d/default.conf 

我们来看 nginx.conf 默认的配置是什么样:

  1. # For more information on configuration, see: 
  2. #   * Official English Documentation: http://nginx.org/en/docs/ 
  3. #   * Official Russian Documentation: http://nginx.org/ru/docs/ 
  4.  
  5. user nginx; 
  6. worker_processes auto; 
  7. error_log /var/log/nginx/error.log; 
  8. pid /run/nginx.pid; 
  9.  
  10. # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. 
  11. include /usr/share/nginx/modules/*.conf; 
  12.  
  13. events { 
  14. worker_connections 1024; 
  15.  
  16. http { 
  17. log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ' 
  18.                   '$status $body_bytes_sent "$http_referer" ' 
  19.                   '"$http_user_agent" "$http_x_forwarded_for"'; 
  20.  
  21. access_log  /var/log/nginx/access.log  main; 
  22.  
  23. sendfile            on; 
  24. tcp_nopush          on; 
  25. tcp_nodelay         on; 
  26. keepalive_timeout   65; 
  27. types_hash_max_size 2048; 
  28.  
  29. include             /etc/nginx/mime.types; 
  30. default_type        application/octet-stream; 
  31.  
  32. # Load modular configuration files from the /etc/nginx/conf.d directory. 
  33. # See http://nginx.org/en/docs/ngx_core_module.html#include 
  34. # for more information. 
  35. include /etc/nginx/conf.d/*.conf; 
  36.  
  37. server { 
  38.     listen       80 default_server; 
  39.     listen       [::]:80 default_server; 
  40.     server_name  _; 
  41.     root         /usr/share/nginx/html; 
  42.  
  43.     # Load configuration files for the default server block. 
  44.     include /etc/nginx/default.d/*.conf; 
  45.  
  46.     location / { 
  47.     } 
  48.  
  49.     error_page 404 /404.html; 
  50.         location = /40x.html { 
  51.     } 
  52.  
  53.     error_page 500 502 503 504 /50x.html; 
  54.         location = /50x.html { 
  55.     } 
  56.  
  57. # Settings for a TLS enabled server. 
  58. #    server { 
  59. #        listen       443 ssl http2 default_server; 
  60. #        listen       [::]:443 ssl http2 default_server; 
  61. #        server_name  _; 
  62. #        root         /usr/share/nginx/html; 
  63. #        ssl_certificate "/etc/pki/nginx/server.crt"; 
  64. #        ssl_certificate_key "/etc/pki/nginx/private/server.key"; 
  65. #        ssl_session_cache shared:SSL:1m; 
  66. #        ssl_session_timeout  10m; 
  67. #        ssl_ciphers HIGH:!aNULL:!MD5; 
  68. #        ssl_prefer_server_ciphers on; 
  69. #        # Load configuration files for the default server block. 
  70. #        include /etc/nginx/default.d/*.conf; 
  71. #        location / { 
  72. #        } 
  73. #        error_page 404 /404.html; 
  74. #            location = /40x.html { 
  75. #        } 
  76. #        error_page 500 502 503 504 /50x.html; 
  77. #            location = /50x.html { 
  78. #        } 
  79. #    } 
  80.  
  81. }  

(编辑:晋中站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读