mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2026-04-25 08:45:58 +03:00
[GH-ISSUE #747] 为什么加了这两句话后,nginx -t就失败了?删除这2句话就好了 #3494
Labels
No labels
Q/A
bug
casdoor
dependencies
docker
documentation
duplicate
enhancement
help wanted
invalid
lego
platform:openwrt
platform:windows
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-ui#3494
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zjqwll on GitHub (Nov 22, 2024).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/747
@Hintay commented on GitHub (Nov 22, 2024):
请按提示信息自行检查/usr/local/soft/nginx/conf/nginx.conf
@zjqwll commented on GitHub (Nov 22, 2024):
#配置用户或者组,默认为nobody nobody
#user nginx;
#user root;
user nobody;
#允许的工作进程:数目。根据硬件调整,通常等于CPU数量或者2倍于CPU
worker_processes auto;
#worker_processes 8;
#设置worker进程的最大打开文件数
worker_rlimit_nofile 65535;
#错误日志存放路径配置和日志级别
error_log /usr/local/soft/nginx/logs/error.log crit;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#指定nginx进程运行文件存放地址
pid /usr/local/soft/nginx/logs/nginx.pid;
#pid logs/nginx.pid;
events {
#每个进程最大连接数(最大连接=连接数x进程数)
worker_connections 1024;
}
#设定http服务器,利用它的反向代理功能提供负载均衡支持
http {
#文件扩展名与文件类型映射表
include mime.types;
}
这是我所有的nginx配置代码,但是只要删除了 以下2句话就正常了
include /usr/local/soft/nginx/conf/.conf;
include /usr/local/soft/nginx/sites-enabled/;
@Hintay commented on GitHub (Nov 22, 2024):
请检查
/usr/local/soft/nginx/conf/nginx.conf文件的第四行,注意是不是您自己先前配置过的文件,这个不是 Nginx UI 的问题。@zjqwll commented on GitHub (Nov 22, 2024):
是的,我也认为不是nginx ui问题,第四行是user nobody;此代码并无不妥,只是奇怪的是,为何加上这两句话后,就会报第四行问题
include /usr/local/soft/nginx/conf/.conf;
include /usr/local/soft/nginx/sites-enabled/;
@Hintay commented on GitHub (Nov 22, 2024):
因为 Nginx 不支持 user 这个 directive
@zjqwll commented on GitHub (Nov 22, 2024):
好的,我再重新安装试试