Hi, nice to meet you!

Docker 使用 nginx-proxy + letsencrypt 实现自动签发 SSL 证书

1. 创建一个自定义网络 nginx-net

1
2
$ docker network create nginx-net
86acd4edf102a2a5f9aaa6ff2638e5372eeffd9dd39070ee97ee1ac252a29492
Docker 使用 nginx-proxy + letsencrypt 实现自动签发 SSL 证书

HTTP TO HTTPS (Centos 6.5 Final)

环境准备

因为 Certbot 的很多依赖并不在系统默认 Repo 中,需要先安装 EPEL Repo ,运行 yum install epel-release ,同时为了防止组件过旧导致的报错,建议运行一次 yum update

安装 Certbot

因为目前没有 CentOS 的预编译安装包,所以通过 certbot-auto 脚本来获得 Certbot .

HTTP TO HTTPS (Centos 6.5 Final)

Nginx 部署 Node Web 项目

Nginx反向代理

由于本例中服务器需要使用 php 服务,所以之前安装了 WDCP 面板(自带LNAMP),所以此处不提如何安装Nginx

  • Nginx添加vhost
  • 修改nginx/conf/vhost/your.domain.conf,如下
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    server {
    listen 80;
    server_name example.com;

    location / {
    proxy_pass http://localhost:9000;
    ···
    }
    ···
    }
Nginx 部署 Node Web 项目

Laravel skills

记录日志

记录日志到 storage\logs\laravel.log

1
2
3
4
$writer = app('log');
$writer->error('updates is :', compact('updates'));
$message = $updates->getMessage();
$writer->error('Message is :', compact('message'));
Laravel skills