偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

使用Caddy作為Web服務(wù)器

系統(tǒng)
Caddy是一個(gè)由Go語言編寫的Web服務(wù)器軟件,可以自動(dòng)實(shí)現(xiàn)HTTPS部署。CaddyFile配置更簡單,很多都是默認(rèn)配置,只要根據(jù)自己的情況,添加需要的參數(shù)即可。

Caddy是一個(gè)由Go語言編寫的Web服務(wù)器軟件,可以自動(dòng)實(shí)現(xiàn)HTTPS部署。

使用caddy作為web服務(wù)器

為什么使用Caddy

自己的博客想要使用https,懶得去更新證書,Caddy可以快速解決我的問題。

而且相比nginx,Caddy部署起來更簡單,就一個(gè)二進(jìn)制文件;

CaddyFile配置更簡單,很多都是默認(rèn)配置,只要根據(jù)自己的情況,添加需要的參數(shù)即可。

功能豐富,但是很多我暫時(shí)用不到,用到再通過插件的方式添加即可。

對(duì)于一個(gè)博客應(yīng)用來說完全夠用了。

安裝Caddy

在CentOS上可以直接使用yum安裝的,也可以下載對(duì)應(yīng)平臺(tái)的二進(jìn)制進(jìn)行安裝。

使用caddy作為web服務(wù)器

安裝命令:

 

  1. yum install yum-plugin-copr -y 
  2. yum copr enable @caddy/caddy -y 
  3. yum install caddy -y 

 

配置

配置文件默認(rèn)是在/etc/caddy/Caddyfile,配置文件只要修改好自己的域名,如果需要https直接填寫上http://xxx就可以了,root執(zhí)行自己的網(wǎng)站目錄即可。

我的網(wǎng)站是hugo生成的靜態(tài)站,直接配置目錄。

如果是php可以直接轉(zhuǎn)發(fā)的php_fastcgi。

 

  1. # The Caddyfile is an easy way to configure your Caddy web server. 
  2. # Unless the file starts with a global options block, the first 
  3. # uncommented line is always the address of your site. 
  4. To use your own domain name (with automatic HTTPS), first make 
  5. # sure your domain's A/AAAA DNS records are properly pointed to 
  6. # this machine's public IP, then replace ":80" below with your 
  7. # domain name
  8.  
  9. www.opcai.top https://www.opcai.top http://opcai.top https://opcai.top { 
  10.          
  11.         # Set this path to your site's directory. 
  12.         root * /data/webroot 
  13.  
  14.         # Enable the static file server. 
  15.         file_server 
  16.          
  17.         # Another common task is to set up a reverse proxy: 
  18.         # reverse_proxy /back/* localhost:8080 
  19.  
  20.         # Or serve a PHP site through php-fpm: 
  21.         # php_fastcgi localhost:9000 
  22.  
  23. # Refer to the Caddy docs for more information: 
  24. # https://caddyserver.com/docs/caddyfile 

 

服務(wù)管理

 

  1. systemctl enable --now caddy  # 啟動(dòng)并設(shè)置開機(jī)啟動(dòng) 
  2. systemctl reload caddy # 重載配置 

 

總結(jié)

Caddy還有很多強(qiáng)大的功能,慢慢探索。

 

責(zé)任編輯:姜華 來源: 今日頭條
相關(guān)推薦

2022-02-21 08:31:49

Centos8Caddy Web服務(wù)器

2020-07-28 09:45:29

LinuxCaddyHTTPS

2009-09-17 18:05:51

Nis服務(wù)器

2010-03-16 16:26:58

nginxWeb緩存服務(wù)器負(fù)載均衡服務(wù)器

2019-07-09 14:57:09

代理服務(wù)器NginxHTTPS

2009-09-17 18:06:44

Nis服務(wù)器

2017-11-10 08:58:49

Web服務(wù)器應(yīng)用程序

2021-08-03 22:51:05

Keycloak授權(quán)服務(wù)器

2010-05-13 18:32:52

2019-02-26 16:20:52

FTP服務(wù)器

2010-12-28 15:39:38

2019-05-14 09:39:07

Web服務(wù)器Web容器應(yīng)用程序服務(wù)器

2010-02-23 16:08:15

2018-10-26 11:30:40

Apache Web服務(wù)器站點(diǎn)

2017-09-06 09:21:04

服務(wù)器C&CDropBox

2019-04-24 15:13:16

Web服務(wù)器應(yīng)用服務(wù)器Web容器

2018-08-07 08:54:18

2012-09-19 09:47:58

PHPWeb服務(wù)器

2013-09-30 10:18:05

Web服務(wù)器宕機(jī)診斷

2016-10-11 12:45:50

PythonWeb服務(wù)器
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)