$ apt-get update
$ apt-get install build-essential libtool libpcre3 libpcre3-dev zlib1g-dev
$ apt-get install openssl
$ apt-get install libssl-dev
复制代码
$ cd /opt/
$ wget http://nginx.org/download/nginx-1.9.9.tar.gz
$ tar zxvf nginx-1.9.9.tar.gz
复制代码
$ cd nginx-1.9.9
$ ./configure --prefix=/usr/local/nginx \--with-http_ssl_module
复制代码
$ make
$ make && make install
复制代码
默认安装在/usr/local/nginx
html
里面有四个目录:nginx
每次修改nginx配置文件后都要进行检查web
$ /usr/local/nginx/sbin/nginx -t
复制代码
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
复制代码
$ /usr/local/nginx/sbin/nginx
复制代码
浏览器输入本机IP ,看到以下内容证实安装成功docker
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
复制代码
$ /usr/local/nginx/sbin/nginx -s stop
复制代码
$ /usr/local/nginx/sbin/nginx -s reload
复制代码
安装很简单, 一个命令:vim
curl https://get.acme.sh | sh
复制代码
cd ~/.acme.sh/
apt install socat
sh acme.sh --issue -d docker.souyunku.com --standalone
复制代码
mkdir -p /certs
cd /root/.acme.sh/docker.souyunku.com
cp docker.souyunku.com.cer /certs
cp docker.souyunku.com.key /certs
复制代码
vim /usr/local/nginx/conf/nginx.conf
复制代码
server {
listen 443;
ssl on;
ssl_certificate /certs/docker.souyunku.com.cer;
ssl_certificate_key /certs/docker.souyunku.com.key;
}
复制代码
每次修改nginx配置文件后都要进行检查浏览器
$ /usr/local/nginx/sbin/nginx -t
复制代码
$ /usr/local/nginx/sbin/nginx
复制代码
浏览器访问:docker.souyunku.com/curl