mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2026-04-25 08:45:58 +03:00
[GH-ISSUE #750] 非常喜欢nginx ui,但是折腾了几天,还是以失败而告终。。。。 #3498
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#3498
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/750
虽然之前一键安装程序能起来,但是没办法读取配置文件,经过测试,发现配置这句话后include /usr/local/soft/nginx/conf/.conf;
就会报各种问题,按照提示注释后,又会报下一句,反正没完没了。include /usr/local/soft/nginx/conf/.conf;后,一切都正常,眼睛都毛冒金花儿了。
网上也没找到资料,也是严格按照官网https://nginxui.com/zh_CN/guide/getting-started.html这么操作的,但是还是失败。
@jearton commented on GitHub (Nov 22, 2024):
在线不是可以修改配置文件么,我用得都好好的,你是不是不懂nginx啊
@zjqwll commented on GitHub (Nov 22, 2024):
在线修改的前提是配置好,我现在配置还没成功,就没办法读取配置文件。现在centos中的nginx只要加了include /usr/local/soft/nginx/conf/.conf;就报错
@0xJacky commented on GitHub (Nov 22, 2024):
/usr/local/soft/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;
}
@0xJacky commented on GitHub (Nov 22, 2024):
不对啊,为什么要在 nginx.conf 里 include /usr/local/soft/nginx/conf/.conf; 这不就循环引用了吗
@zjqwll commented on GitHub (Nov 22, 2024):
这里面不是说要这么加的么
@0xJacky commented on GitHub (Nov 22, 2024):
这个是参考示例,你要根据实际环境的配置情况,因地制宜。
@zjqwll commented on GitHub (Nov 22, 2024):
我是centos,按这个说的话,我的确是应该配置的
我第一次使用一键安装后,服务起来了,但是nginx/sites-enabled下面没有内容
@Hintay commented on GitHub (Nov 22, 2024):
请注意,我们在文档中包含的是
conf.d目录和sites-enabled目录下的*.conf文件,不知道为什么你为曲解成conf目录。.d后缀的文件夹一般是用于管理格式相同,目的一致的配置文件。此外我们也附上了 Debian 完整的配置文件给你参考,配置不要文档只看一半就按自己的理解写啊。@Hintay commented on GitHub (Nov 22, 2024):
请参考 Debian 的结构来修改你的配置目录后才可正常使用:
https://salsa.debian.org/nginx-team/nginx/-/blob/master/debian/conf/nginx.conf
@zjqwll commented on GitHub (Nov 22, 2024):
好的,谢谢哈。不过我看了https://salsa.debian.org/nginx-team/nginx/-/blob/master/debian/conf/nginx.conf,感觉还是要配置那两句话,依然没看懂。
include /etc/nginx/conf.d/.conf;
include /etc/nginx/sites-enabled/;
我不知道我到底是要配还是不配置以上2句话。我没有conf.d
@Hintay commented on GitHub (Nov 22, 2024):
前面那个 issue 中提示不支持 user 指令的原因是重复包含了 nginx.conf 文件,导致第二个 user 指令在 http 块中。user 指令需要在最外层,而且只能有一个。
@zjqwll commented on GitHub (Nov 22, 2024):
@zjqwll commented on GitHub (Nov 22, 2024):
如果不需要配置include /etc/nginx/conf.d/.conf;,但是应该是需要配置include /usr/local/soft/nginx/sites-enabled/*;不然服务启动后,读取不到配置文件
@Hintay commented on GitHub (Nov 22, 2024):
此外,你需要把以前写在 nginx.conf 中的 server 块除了最上面默认的块之外,都按 Server Name 分成单个文件放在 sites-available 目录中,这样 Nginx UI 才能对网站进行管理。