VPS侦探论坛

 找回密码
 注册
查看: 1728|回复: 3

nginx1.24.0配置文件报错!

[复制链接]
发表于 2023-6-14 20:05:16 | 显示全部楼层 |阅读模式


搬家发现原来的配置文件报错 报错行如下
listen 443 ssl http2;
Reload nginx... nginx: [warn] protocol options redefined for 0.0.0.0:443

就是默认新建站点 添加主机 也一样会报错!












nginx version: nginx/1.24.0

美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2023-6-14 20:21:01 | 显示全部楼层


本帖最后由 每次醒来 于 2023-6-14 20:22 编辑


Reload nginx... nginx: [warn] protocol options redefined for 0.0.0.0:443 in /usr/local/nginx/conf/vhost/www.123.net.conf:44
done

  1. server
  2.     {
  3.         listen 80;
  4.         #listen [::]:80;
  5.         server_name www.123.net 123.net;
  6.         index index.html index.htm index.php default.html default.htm default.php;
  7.         root  /home/wwwroot/www.123.net;

  8.         #include rewrite/none.conf;
  9.         #error_page   404   /404.html;

  10.         # Deny access to PHP files in specific directory
  11.         #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

  12.         include enable-php.conf;

  13.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  14.         {
  15.             expires      30d;
  16.         }

  17.         location ~ .*\.(js|css)?$
  18.         {
  19.             expires      12h;
  20.         }

  21.         location ~ /.well-known {
  22.             allow all;
  23.         }

  24.         location ~ /\.
  25.         {
  26.             deny all;
  27.         }

  28.         location / {
  29.             return 301 https://123.net$request_uri;
  30.         }

  31.         access_log off;
  32.     }
  33. server
  34.     {
  35.         listen 443 ssl http2;
  36.         #listen [::]:443 ssl http2;
  37.         server_name www.123.net 123.net;
  38.         index index.html index.htm index.php default.html default.htm default.php;
  39.         root  /home/wwwroot/www.123.net;

  40.         ssl_certificate /usr/local/nginx/conf/ssl/www.123.net/fullchain.cer;
  41.         ssl_certificate_key /usr/local/nginx/conf/ssl/www.123.net/www.123.net.key;
  42.         ssl_session_timeout 5m;
  43.         ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
  44.         ssl_prefer_server_ciphers on;
  45.         ssl_ciphers "TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5";
  46.         ssl_session_cache builtin:1000 shared:SSL:10m;
  47.         # openssl dhparam -out /usr/local/nginx/conf/ssl/dhparam.pem 2048
  48.         ssl_dhparam /usr/local/nginx/conf/ssl/dhparam.pem;

  49.         include rewrite/typecho.conf;
  50.         #error_page   404   /404.html;

  51.         # Deny access to PHP files in specific directory
  52.         #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

  53.         include enable-php.conf;

  54.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  55.         {
  56.             expires      30d;
  57.         }

  58.         location ~ .*\.(js|css)?$
  59.         {
  60.             expires      12h;
  61.         }

  62.         location ~ /.well-known {
  63.             allow all;
  64.         }

  65.         location ~ /\.
  66.         {
  67.             deny all;
  68.         }

  69.         access_log off;
  70.     }
复制代码


Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2023-6-15 18:42:13 | 显示全部楼层

设置了空主机头是吧?可以看一下空主机头帖子里面有说明
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2023-6-15 20:45:57 | 显示全部楼层



licess 发表于 2023-6-15 18:42
设置了空主机头是吧?可以看一下空主机头帖子里面有说明

奇怪修改成 listen 443 ssl http2 default_server reuseport; 也不行
其它虚拟主机配置文件一样也不报错
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-5-19 20:35 , Processed in 0.026174 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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