首页 > 代码库 > https nginx配置

https nginx配置

cd /saas/conf/nginx/

mkdir key

cd key

创建key:

openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr

生成使用签名请求证书和私钥生成自签证书:

openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

 

server {
  listen 80;
  listen 443;
  ssl on;
  ssl_certificate key/server.crt;
  ssl_certificate_key key/server.key;

  ....

}

https nginx配置