宝塔618特惠活动,企业版999元/年,宝塔SSL证书买1送1!限时抢购!查看活动
当前位置:论坛首页 > Linux面板 > 求助

【已完成】更新8.20后nginx无法启动

发表在 Linux面板2024-6-6 09:48  关闭 [复制链接] 6 1808

为了能快速了解并处理您的问题,请提供以下基础信息:
面板、插件版本:8.20
系统版本:nginx/1.26.1
问题描述:更新面板8.20后重启服务器后nginx/1.26.1无法启动

微信截图_20240606101922.png 微信截图_20240606094421.png 微信截图_20240606094800.png 微信截图_20240606094740.png
使用道具 举报 只看该作者 回复
发表于 2024-6-6 10:42:55 | 显示全部楼层
  1. user  www www;
  2. worker_processes auto;
  3. error_log  /www/wwwlogs/nginx_error.log  crit;
  4. pid        /www/server/nginx/logs/nginx.pid;
  5. worker_rlimit_nofile 51200;

  6. stream {
  7.     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';
  8.   
  9.     access_log /www/wwwlogs/tcp-access.log tcp_format;
  10.     error_log /www/wwwlogs/tcp-error.log;
  11.     include /www/server/panel/vhost/nginx/tcp/*.conf;
  12. }

  13. events
  14.     {
  15.         use epoll;
  16.         worker_connections 51200;
  17.         multi_accept on;
  18.     }

  19. http
  20.     {
  21.         include       mime.types;
  22.                 #include luawaf.conf;

  23.                 include proxy.conf;
  24.         lua_package_path "/www/server/nginx/lib/lua/?.lua;;";

  25.         default_type  application/octet-stream;

  26.         server_names_hash_bucket_size 512;
  27.         client_header_buffer_size 32k;
  28.         large_client_header_buffers 4 32k;
  29.         client_max_body_size 50m;

  30.         sendfile   on;
  31.         tcp_nopush on;

  32.         keepalive_timeout 60;

  33.         tcp_nodelay on;

  34.         fastcgi_connect_timeout 300;
  35.         fastcgi_send_timeout 300;
  36.         fastcgi_read_timeout 300;
  37.         fastcgi_buffer_size 64k;
  38.         fastcgi_buffers 4 64k;
  39.         fastcgi_busy_buffers_size 128k;
  40.         fastcgi_temp_file_write_size 256k;
  41.                 fastcgi_intercept_errors on;

  42.         gzip on;
  43.         gzip_min_length  1k;
  44.         gzip_buffers     4 16k;
  45.         gzip_http_version 1.1;
  46.         gzip_comp_level 2;
  47.         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;
  48.         gzip_vary on;
  49.         gzip_proxied   expired no-cache no-store private auth;
  50.         gzip_disable   "MSIE [1-6]\.";

  51.         limit_conn_zone $binary_remote_addr zone=perip:10m;
  52.                 limit_conn_zone $server_name zone=perserver:10m;

  53.         server_tokens off;
  54.         access_log off;

  55. server
  56.     {
  57.         listen 888;
  58.         server_name phpmyadmin;
  59.         index index.html index.htm index.php;
  60.         root  /www/server/phpmyadmin;

  61.         #error_page   404   /404.html;
  62.         include enable-php.conf;

  63.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  64.         {
  65.             expires      30d;
  66.         }

  67.         location ~ .*\.(js|css)?$
  68.         {
  69.             expires      12h;
  70.         }

  71.         location ~ /\.
  72.         {
  73.             deny all;
  74.         }

  75.         access_log  /www/wwwlogs/access.log;
  76.     }
  77. include /www/server/panel/vhost/nginx/*.conf;
  78. }

复制代码
使用道具 举报 回复 支持 反对
发表于 2024-6-6 11:16:44 | 显示全部楼层
本帖最后由 liuhongxin 于 2024-6-6 11:37 编辑
  1. server {
  2.     listen 80 default_server;
  3.                 listen 443 ssl  default_server;
  4.    
  5.     server_tokens off;
  6.     server_name (隐藏内容);
  7.     keepalive_timeout 5;
  8.     client_max_body_size 50m;
  9.     root /usr/local/lighthouse/softwares/wordpress;
  10.     index index.php index.html;
  11.     include /www/server/panel/vhost/nginx/proxy/wordpress.local/*.conf;

  12. include enable-php-81.conf;

  13.     #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
  14.     #error_page 404/404.html;
  15.     #HTTP_TO_HTTPS_START
  16.     if ($server_port !~ 443){
  17.         rewrite ^(/.*)$ https://$host$1 permanent;
  18.     }
  19.     #HTTP_TO_HTTPS_END
  20.     ssl_certificate    /www/server/panel/vhost/cert/wordpress.local/fullchain.pem;
  21.     ssl_certificate_key    /www/server/panel/vhost/cert/wordpress.local/privkey.pem;
  22.     ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
  23.     ssl_ciphers (隐藏内容);
  24.     ssl_prefer_server_ciphers on;
  25.     ssl_session_cache shared:SSL:10m;
  26.     ssl_session_timeout 10m;
  27.     add_header Strict-Transport-Security "max-age=31536000";
  28.     error_page 497  https://$host$request_uri;
  29.                 #SSL-END
  30.         #引用重定向规则,注释后配置的重定向代理将无效
  31.         include /www/server/panel/vhost/nginx/redirect/wordpress.local/*.conf;

  32.     #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
  33.     include /www/server/panel/vhost/rewrite/wordpress.local.conf;
  34.     #REWRITE-END
  35.     location / {
  36.         try_files $uri $uri/ /index.php?$query_string;
  37.     }
  38.     #禁止访问的文件或目录
  39.     location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
  40.     {
  41.         return 404;
  42.     }

  43.     #一键申请SSL证书验证目录相关设置
  44.     location ~ \.well-known{
  45.         allow all;
  46.     }

  47.     access_log  /www/wwwlogs/wordpress.local.log;
  48.     error_log  /www/wwwlogs/wordpress.local.error.log;
  49. }
复制代码
使用道具 举报 回复 支持 反对
发表于 2024-6-6 11:26:29 | 显示全部楼层
删除38行就能启动了,这是什么BUG
  1.     #REWRITE-END
  2.     location / {
  3.         try_files $uri $uri/ /index.php?$query_string;
  4.     }
复制代码
使用道具 举报 回复 支持 反对
发表于 2024-6-6 15:16:02 | 显示全部楼层
liuhongxin 发表于 2024-6-6 11:26
删除38行就能启动了,这是什么BUG

您好,从您图片中错误读取到信息是,nginx: [warn] 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: [emerg] duplicate location "/" in /www/server/panel/vhost/nginx/wordpress.local.conf:37":这个错误信息显示在配置文件中有重复的location"/"指令,在第37行和其他地方都定义了相同的location。需要检查并移除其中一个重复的location配置。
使用道具 举报 回复 支持 反对
发表于 2024-6-7 09:10:37 | 显示全部楼层
运维技术阿闯 发表于 2024-6-6 15:16
您好,从您图片中错误读取到信息是,nginx: [warn] the "listen ... http2" directive is deprecated, us ...

好的,我直接删除了出错的一段代码,不知道是否影响功能,不过网站运行正常,对这些技术性的不太了解我属于小白,没有其他问题了,感谢。
使用道具 举报 回复 支持 反对
发表于 2024-6-7 12:06:59 | 显示全部楼层
liuhongxin 发表于 2024-6-7 09:10
好的,我直接删除了出错的一段代码,不知道是否影响功能,不过网站运行正常,对这些技术性的不太了解我属 ...

好的,后续有问题可以在开新帖呢,这边就闭贴了,祝您生活愉快
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术免费分析

工作时间:09:00至18:30

快速回复 返回顶部 返回列表