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

相关推荐
2601_962381137 小时前
历史视频朝代更替动效怎么做?把 AE 关键帧换成 AI 分镜动画的实战拆解
人工智能·nginx·音视频
数据杂坛10 小时前
【Python程序开发系列】一文搞清楚Gunicorn以及和Nginx的区别
python·nginx·gunicorn
锅巴编程10 小时前
nginx-413-client-max-body-size
运维·nginx
zxanz111 小时前
SSL 证书会影响 GEO 跟 SEO 排名吗?
网络·网络协议·ssl
cpolar技术支持15 小时前
服务器上的 Nginx 只想改配置却不敢动?把 Nginx-UI 跑起来,用 MCP 让 AI 助手帮你安全改配置,再用 cpolar 把面板短时开给自己
nginx·ai·cpolar·mcp·nginx-ui
春天花会开1311 天前
内网 HTTPS 部署实战:私有 CA + Nginx 反向代理全流程复盘
运维·nginx·https
还是大剑师兰特6 天前
解决nginx错误:http://localhost:7000正常,http://localhost:7000/map 报错404
nginx·大剑师
xing-xing7 天前
Docker容器中Nginx站点根目录网页配置访问
nginx·docker
2501_916007477 天前
苹果商店iOS应用上架费用全面解析:开发者计划与审核费用计算
android·ios·小程序·https·uni-app·iphone·webview
Lsetea7 天前
证书没到期却报certificate has expired:OpenSSL定位中间证书与系统时间
运维·https·ssl证书·openssl·证书链