Installation under Linux using certbot https certificate and configure nginx

This article only Centos6.x test no problem, 7+ self-test

Deployment certbot

wget https://dl.eff.org/certbot-auto

cp certbot-auto /usr/bin/

chmod a+x /usr/bin/certbot-auto

Install Certificate

./certbot-auto certonly

Nginx configuration

server {

listen 80 default_server;

listen [::]:80 default_server;

server_name your domain name;

root /usr/share/nginx/html;

# Load configuration files for the default server block.

include /etc/nginx/default.d/*.conf;

location / {

}

}

server{

listen 443;

server_name your domain name;

ssl on;

root /usr/share/nginx/html;

ssl_certificate your certificate;

ssl_certificate_key your certificate;

}

Note: When copying and pasting format requires its own alignment

nginx -t

# Check syntactic correctness

nginx -s reload

# Reload the configuration file

Browser Access Project https + domain, verification certificate, no problem!

No pro-test pit! ! !

Published 21 original articles · won praise 5 · Views 398

Guess you like

Origin blog.csdn.net/weixin_41762839/article/details/105194985