阿里云 ECS 主机 nginx 默认目录/etc/nginx
上传站点的工具 Yummy FTP
如果一站点既要 80 http 访问,又要 443https 访问。

E614-58F6-8C40-04FA 3A1E-C0D8-F27B-E12A BCA0-D3CA-32F5-BF9C EBA1-9D6D-FC0F-6064

要让 https 和 http 并存,不能在配置文件中使用 ssl on,配置 listen 443 ssl;

实例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
server {
listen 80 default_server;
listen [::]:80 default_server;
listen 443 ssl;
server_name _;
root /usr/share/nginx/html;
ssl_certificate "cert/1483067_www.ru23.com.pem";
ssl_certificate_key "cert/1483067_www.ru23.com.key";
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
}

error_page 404 /404.html;
location = /40x.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}

转载请保持原始链接

原始链接: https://ru23.com/note/1cdb2279.html