nginx 实现https代理转发 转发成功后很多js,css等加载不出来,报404...
发布网友
发布时间:2022-04-25 15:13
我来回答
共1个回答
热心网友
时间:2022-04-14 09:59
您好,nginx服务器SSL证书配置如下,请你自查,下面是用的沃通SSL测试证书,你可要申请沃通免费SSL证书用。
打开 Nginx 安装目录下 conf 目录中的 nginx.conf 文件找到
# HTTPS server
#
#server {
# listen 443;
# server_name localhost;
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_timeout 5m;
# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
将其修改为 :
server {
listen 443;
server_name localhost;
ssl on;
ssl_certificate sslkey/wosign.com.crt; (证书公钥)
ssl_certificate_key sslkey/wosign.com.key; (证书私钥)
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ALL:!ADH:!EXPORT56:-RC4+RSA:+HIGH:+MEDIUM:!EXP;
ssl_prefer_server_ciphers on;
location / {
root html;
index index.html index.htm;
}
}
保存退出,并重启 Nginx。通过 https 方式访问您的站点,测试站点证书的安装配置。