A single server that handles both HTTP and HTTPS requests

来自linux中国网wiki
Evan讨论 | 贡献2019年10月14日 (一) 13:48的版本 (导入1个版本)
跳到导航 跳到搜索

a single server that handles both HTTP and HTTPS requests


A single HTTP/HTTPS server
It is possible to configure a single server that handles both HTTP and HTTPS requests:

server {
    listen              80;
    listen              443 ssl;
    server_name         www.example.com;
    ssl_certificate     www.example.com.crt;
    ssl_certificate_key www.example.com.key;
    ...
}


参考

http://nginx.org/en/docs/http/configuring_https_servers.html#single_http_https_server