目前创建的网站有两个,两个都完全正常,新建一个网站用于创建phpmyadmin,域名是php.xxx.yyy,域名解析正常,可以正常打开证明没出错,然后建站市场一键安装phpmyadmin没报错,但刷新该网址就404 Not Found nginx/1.18.0 有关组件: nginx: 1.18.0 php: 8.0.1 MySQL: 10.4.17-MariaDB 有需要提供的信息请介绍,尽量都提供
root@VM-12-16-centos ~ # systemctl stop nginx;sleep 3;systemctl start nginx root@VM-12-16-centos ~ # nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful root@VM-12-16-centos ~ #
配置无错,重启过无效,如果不开启https就是404,开启就是HTTP ERROR 500 源文件:
limit_conn_zone $server_name zone=appnode_sitemgr_site_conn_pma.abcdef.xyz:100k; limit_req_zone $server_name zone=appnode_sitemgr_site_req_pma.abcdef.xyz:100k rate=10000r/m; limit_req_zone $binary_remote_addr zone=appnode_sitemgr_ip_req_pma.abcdef.xyz:1m rate=500r/m; lua_shared_dict appnode_sitemgr_cc_count_pma.abcdef.xyz 1m; lua_shared_dict appnode_sitemgr_cc_blocked_pma.abcdef.xyz 100k; lua_shared_dict appnode_sitemgr_cc_banned_pma.abcdef.xyz 100k; server { listen 80; listen 443 ssl http2; server_name pma.abcdef.xyz; ssl_certificate /data/mainenv/sites/pma.abcdef.xyz/ssl/site.crt; ssl_certificate_key /data/mainenv/sites/pma.abcdef.xyz/ssl/site.key; ssl_prefer_server_ciphers on; ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_session_cache shared:SSL:5m; ssl_session_timeout 5m; if ($http_user_agent ~* (baiduspider|360spider|googlebot|soso|bing|sogou|yahoo|yisouspider|sohu-search|yodao|YoudaoBot|robozilla|msnbot|MJ12bot|NHN|Twiceler)) { return 404; } keepalive_timeout 75s; keepalive_requests 100; access_log /data/mainenv/sites/pma.abcdef.xyz/log/nginx/access.log; error_log /data/mainenv/sites/pma.abcdef.xyz/log/nginx/error.log; pagespeed on; pagespeed FileCachePath /data/mainenv/sites/pma.abcdef.xyz/cache/ngx_pagespeed; pagespeed LowercaseHtmlNames on; pagespeed PreserveUrlRelativity on; pagespeed RespectVary on; pagespeed XHeaderValue 'Powered By AppNode'; pagespeed EnableFilters remove_comments,collapse_whitespace,combine_css,rewrite_css,sprite_images,combine_javascript,rewrite_javascript,rewrite_images,lazyload_images,prioritize_critical_css,extend_cache; pagespeed FileCacheCleanIntervalMs 3600; pagespeed FileCacheSizeKb 102400; pagespeed FileCacheInodeLimit 500000; pagespeed AdminPath /pagespeed_admin; pagespeed PurgeMethod PURGE; pagespeed EnableCachePurge on; root /data/mainenv/sites/pma.abcdef.xyz/www; set_real_ip_from 127.0.0.1; real_ip_header X-Real-IP; real_ip_recursive on; add_header Access-Control-Allow-Origin *; if ($scheme = http) { return 301 https://$host$request_uri; } gzip on; gzip_comp_level 6; gzip_min_length 1k; gzip_types text/plain text/css text/xml text/javascript text/x-component application/json application/javascript application/x-javascript application/xml application/xhtml+xml application/rss+xml application/atom+xml application/x-font-ttf application/vnd.ms-fontobject image/svg+xml image/x-icon font/opentype; brotli on; brotli_comp_level 6; brotli_min_length 1k; brotli_types text/plain text/css text/xml text/javascript text/x-component application/json application/javascript application/x-javascript application/xml application/xhtml+xml application/rss+xml application/atom+xml application/x-font-ttf application/vnd.ms-fontobject image/svg+xml image/x-icon font/opentype; client_max_body_size 10M; ssi on; limit_conn appnode_sitemgr_site_conn_pma.abcdef.xyz 1000; access_by_lua_file /data/mainenv/sites/pma.abcdef.xyz/conf/access.lua; location / { if ($request_method = OPTIONS) { add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,OPTIONS; return 204; } add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains'; index index.html index.htm index.php; } location = /__appnode_anti_cc_admin { allow 127.0.0.1; deny all; } location = /__appnode_anti_cc_log { internal; access_log /data/mainenv/sites/pma.abcdef.xyz/log/nginx/cc_attack.log; } location ~ '\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+' { add_header '' ''; } location ~ ^/pagespeed_static/ { } location ~ ^/ngx_pagespeed_beacon$ { } location ~ ^/pagespeed_admin { allow 127.0.0.1; deny all; } location ~ ^/.+\.php(/|$) { include conf.sitemgr.d/global/conf/fastcgi_params; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /data/mainenv/sites/pma.abcdef.xyz/www$fastcgi_script_name; fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_read_timeout 60s; fastcgi_pass unix:/data/mainenv/php-pools/appnode_sitemgr_shared_gapfgp/php-fpm.sock; limit_req zone=appnode_sitemgr_site_req_pma.abcdef.xyz burst=1000 nodelay; limit_req zone=appnode_sitemgr_ip_req_pma.abcdef.xyz burst=50 nodelay; } location ~* \.(js|css|png|jpg|jpeg|gif|ico|bmp|swf|eot|svg|ttf|woff|woff2)$ { expires 30d; log_not_found off; } }
虚竹 1. 检测下配置是否有错误(网站列表上方有按钮) 2. 停止后再启动nginx服务,看看配置是否生效 3. 给出phpmyadmin站点的nginx源文配置