【已完成】更新8.20后nginx无法启动
为了能快速了解并处理您的问题,请提供以下基础信息:面板、插件版本:8.20系统版本:nginx/1.26.1
问题描述:更新面板8.20后重启服务器后nginx/1.26.1无法启动
userwww www;
worker_processes auto;
error_log/www/wwwlogs/nginx_error.logcrit;
pid /www/server/nginx/logs/nginx.pid;
worker_rlimit_nofile 51200;
stream {
log_format tcp_format '$time_local|$remote_addr|$protocol|$status|$bytes_sent|$bytes_received|$session_time|$upstream_addr|$upstream_bytes_sent|$upstream_bytes_received|$upstream_connect_time';
access_log /www/wwwlogs/tcp-access.log tcp_format;
error_log /www/wwwlogs/tcp-error.log;
include /www/server/panel/vhost/nginx/tcp/*.conf;
}
events
{
use epoll;
worker_connections 51200;
multi_accept on;
}
http
{
include mime.types;
#include luawaf.conf;
include proxy.conf;
lua_package_path "/www/server/nginx/lib/lua/?.lua;;";
default_typeapplication/octet-stream;
server_names_hash_bucket_size 512;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
gzip on;
gzip_min_length1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/json image/jpeg image/gif image/png font/ttf font/otf image/svg+xml application/xml+rss text/x-js;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE \.";
limit_conn_zone $binary_remote_addr zone=perip:10m;
limit_conn_zone $server_name zone=perserver:10m;
server_tokens off;
access_log off;
server
{
listen 888;
server_name phpmyadmin;
index index.html index.htm index.php;
root/www/server/phpmyadmin;
#error_page 404 /404.html;
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
access_log/www/wwwlogs/access.log;
}
include /www/server/panel/vhost/nginx/*.conf;
}
本帖最后由 liuhongxin 于 2024-6-6 11:37 编辑
server {
listen 80 default_server;
listen 443 ssldefault_server;
server_tokens off;
server_name (隐藏内容);
keepalive_timeout 5;
client_max_body_size 50m;
root /usr/local/lighthouse/softwares/wordpress;
index index.php index.html;
include /www/server/panel/vhost/nginx/proxy/wordpress.local/*.conf;
include enable-php-81.conf;
#SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
#error_page 404/404.html;
#HTTP_TO_HTTPS_START
if ($server_port !~ 443){
rewrite ^(/.*)$ https://$host$1 permanent;
}
#HTTP_TO_HTTPS_END
ssl_certificate /www/server/panel/vhost/cert/wordpress.local/fullchain.pem;
ssl_certificate_key /www/server/panel/vhost/cert/wordpress.local/privkey.pem;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers (隐藏内容);
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
add_header Strict-Transport-Security "max-age=31536000";
error_page 497https://$host$request_uri;
#SSL-END
#引用重定向规则,注释后配置的重定向代理将无效
include /www/server/panel/vhost/nginx/redirect/wordpress.local/*.conf;
#REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
include /www/server/panel/vhost/rewrite/wordpress.local.conf;
#REWRITE-END
location / {
try_files $uri $uri/ /index.php?$query_string;
}
#禁止访问的文件或目录
location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
{
return 404;
}
#一键申请SSL证书验证目录相关设置
location ~ \.well-known{
allow all;
}
access_log/www/wwwlogs/wordpress.local.log;
error_log/www/wwwlogs/wordpress.local.error.log;
} 删除38行就能启动了,这是什么BUG
#REWRITE-END
location / {
try_files $uri $uri/ /index.php?$query_string;
} liuhongxin 发表于 2024-6-6 11:26
删除38行就能启动了,这是什么BUG
您好,从您图片中错误读取到信息是,nginx: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /www/server/panel/vhost/nginx/wordpress.local.conf:3":这个警告信息表明在你的Nginx配置文件中使用了被弃用的"listen ... http2"指令。建议改用新的" http2"指令来启用 HTTP/2。
"nginx: duplicate location "/" in /www/server/panel/vhost/nginx/wordpress.local.conf:37":这个错误信息显示在配置文件中有重复的location"/"指令,在第37行和其他地方都定义了相同的location。需要检查并移除其中一个重复的location配置。 运维技术阿闯 发表于 2024-6-6 15:16
您好,从您图片中错误读取到信息是,nginx: the "listen ... http2" directive is deprecated, us ...
好的,我直接删除了出错的一段代码,不知道是否影响功能,不过网站运行正常,对这些技术性的不太了解我属于小白,没有其他问题了,感谢。 liuhongxin 发表于 2024-6-7 09:10
好的,我直接删除了出错的一段代码,不知道是否影响功能,不过网站运行正常,对这些技术性的不太了解我属 ...
好的,后续有问题可以在开新帖呢,这边就闭贴了,祝您生活愉快
页:
[1]