按照配置文档设置后重启ngnix报错
upstream halo {
server 127.0.0.1:8090;
}
server
{
listen 80;
listen 443 ssl;
server_name esiyi.top www.esiyi.top;
index index.php index.html index.htm default.php default.htm default.html;
root C:/Users/Administrator/.halo;
#START-ERROR-PAGE
#error_page 403 /403.html;
error_page 404 /404.html;
#error_page 502 /502.html;
#END-ERROR-PAGE
#HTTP_TO_HTTPS_START
if ($server_port !~ 443){
rewrite ^(/.*)$ https://$host$1 permanent;
}
#HTTP_TO_HTTPS_END
#LIMIT_INFO_START
#LIMIT_INFO_END
#SSL-INFO-START
ssl_certificate ssl/esiyi.top/fullchain.pem;
ssl_certificate_key ssl/esiyi.top/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
error_page 497 https://$host$request_uri;
#SSL-INFO-END
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
proxy_pass http://halo;//添加
expires 30d;
error_log /dev/null;
access_log off;
}
location ~ .*.(js|css)?$
{
proxy_pass http://halo;
expires 12h;
error_log /dev/null;
access_log off;
}
location / {
proxy_pass http://halo;
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
#反代清理缓存配置
location ~ /purge(/.*) {
proxy_cache_purge cache_one $1$is_args$args;
}
#proxy 反向代理
include proxy/esiyi.top/*.conf;
#PHP-INFO-START
include php/00.conf;
#PHP-INFO-END
#REWRITE-START
include rewrite/esiyi.top/*.conf;
#REWRITE-END
#redirect 重定向
include redirect/esiyi.top/*.conf;
#禁止访问的文件或目录
location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
{
return 404;
}
#一键申请SSL证书验证目录相关设置
location ~ \.well-known{
allow all;
}
access_log C:/BtSoft/wwwlogs/esiyi.top.log;
error_log C:/BtSoft/wwwlogs/esiyi.top.error.log;
}