web服务器 - https能不能一个主机上配置多个web应用
本文介绍了web服务器 - https能不能一个主机上配置多个web应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
想在一个主机上配置https,有三个域名,aaa.com bbb.net ccc.org, 对应三个不同端口的项目,可以给它们都配上https吗?nginx应该怎么写?
用Letsencrypt配置了aaa.com的https,其他两个项目应该怎么配呢?
解决方案
aaa.com
server {
listen 443;
server_name aaa.com;
ssl on;
ssl_certificate /path/to/aaa.com_fullchain.pem;
ssl_certificate_key /path/to/aaa.com_privkey.pem;
charset utf-8;
access_log /var/logs/aaa.com.access.log;
location / {
root html/aaa.com;
index index.html index.htm;
}
}
bbb.net
server {
listen 443;
server_name bbb.net;
ssl on;
ssl_certificate /path/to/bbb.net_fullchain.pem;
ssl_certificate_key /path/to/bbb.net_privkey.pem;
charset utf-8;
access_log /var/logs/bbb.net.access.log;
location / {
root html/bbb.net;
index index.html index.htm;
}
}
ccc.org
server {
listen 443;
server_name ccc.org;
ssl on;
ssl_certificate /path/to/ccc.org_fullchain.pem;
ssl_certificate_key /path/to/ccc.org_privkey.pem;
charset utf-8;
access_log /var/logs/ccc.org.access.log;
location / {
root html/ccc.org;
index index.html index.htm;
}
}
这篇关于web服务器 - https能不能一个主机上配置多个web应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文