我们的 AWS EC2 实例上出现了这个奇怪的问题,当我们在该特定 EC2 实例上激活“AWS SSL 证书”时,它将不起作用,相反,尽管 SSL 已成功安装,但它只会显示默认的“NGINX”页面。
之前的 SSL 已过期且由第三方提供,因此现在网站显示 SSL 不安全警告。
NGINX 配置
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
#ssl on;
ssl_certificate /ssl/2021/star_APP-Name.pem;
ssl_certificate_key /ssl/private-key-APP-Name.pem;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name dev.nomi.com.au;
location / {
try_files $uri $uri/ /index.php$is_args$args;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
client_max_body_size 100M;
#rewrite \.(?:jpe?g|gif|png)$ /wp-content/plugins/adaptive-images/adaptive-images-script.php;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#fastcgi_pass unix:/run/php/php7.3-fpm.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_param COUNTRY-CODE $geoip2_data_country_code;
add_header COUNTRY-CODE $geoip2_data_country_code;
client_max_body_size 100M;
}
位置 ~* .(?:manifest|appcache|xml|json)$ { 过期时间 -1; }
#pagespeed 开启;#pagespeed FileCachePath "/var/cache/ngx_pagespeed/";#pagespeed RewriteLevel OptimizeForBandwidth;
#location ~ ".pagespeed.([az].)?[az]{2}.[^.]{10}.[^.]+" {
添加标题“” “”;
#}
#location ~ "^/pagespeed_static/" { }
#location ~ "^/ngx_pagespeed_beacon$" { }
location ~* \.(eot|ttf|woff|woff2)$ {
#add_header 'Access-Control-Allow-Origin' '*';
#add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
expires 30d;
}
#location ~* \.(jpg|jpeg|png|gif|ico|svg|css|js)$ {
# expires 30d;
#}
if (!-e $request_filename) {
rewrite /wp-admin$ $scheme://$host$request_uri/ permanent;
rewrite ^(/[^/]+)?(/wp-.*) $2 last;
rewrite ^(/[^/]+)?(/.*\.php) $2 last;
}
#include /etc/nginx/global/wordpress.conf;
}
谢谢你!