ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

nginx部署https域名ssl证书

2026/8/27 16:01:20 拓冰建站 浏览量
nginx部署https域名ssl证书
1、在你服务器nginx文件夹下创建ssl文件夹存放证书文件和秘钥文件

把.crt和.key证书放上

2、在nginx.conf文件中配置

在nginx.conf文件中server下加入listen 443 ssl;

  server {listen       443 ssl;charset utf-8;index index.html index.htm index.jsp index.do;add_header Cache-Control no-cache;root /opt/apm/;server_name  apm.jomoo.cn;ssl_certificate      /usr/local/nginx/ssl/scs_server.crt;ssl_certificate_key  /usr/local/nginx/ssl/scs_server.key;ssl_session_cache    shared:SSL:1m;ssl_session_timeout  5m;ssl_ciphers  HIGH:!aNULL:!MD5;ssl_prefer_server_ciphers  on;location /card/alert {proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header Host $host;proxy_pass http://10.1.1.1:7777/card/alert;}location /card/now {proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header Host $host;proxy_pass http://10.1.1.1:7777/card/alert;}location /console {try_files $uri $uri/ /console/index.html;}location /console/api/system {proxy_buffer_size 64k;proxy_buffers  32 32k;proxy_busy_buffers_size 128k;proxy_set_header X-Real-IP    $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header Host $host;proxy_pass http://10.0.10.10:10000/nisbos/system;}location /console/api/niscommon {proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header Host $host;proxy_pass http://10.0.10.10:10000/niscommon;}location /console-scheduler/ {proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header REMOTE-HOST $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass http://10.0.10.10:10000/;}}
3、重启nginx

/usr/local/nginx/sbin/nginx -s reload

nginx安装ssl模块http_ssl_module

https://blog.csdn.net/weixin_44371237/article/details/135840006

访问不了,检查一下443端口有没有开

https://blog.csdn.net/weixin_44371237/article/details/135846457