Replies: 15 comments 1 reply
-
在线不是可以修改配置文件么,我用得都好好的,你是不是不懂nginx啊 |
Beta Was this translation helpful? Give feedback.
-
在线修改的前提是配置好,我现在配置还没成功,就没办法读取配置文件。现在centos中的nginx只要加了include /usr/local/soft/nginx/conf/.conf;就报错 |
Beta Was this translation helpful? Give feedback.
-
/usr/local/soft/nginx/conf 里面放的什么配置文件,脱敏之后贴出来看看 |
Beta Was this translation helpful? Give feedback.
-
#配置用户或者组,默认为nobody nobody #允许的工作进程:数目。根据硬件调整,通常等于CPU数量或者2倍于CPU #设置worker进程的最大打开文件数 #错误日志存放路径配置和日志级别 #指定nginx进程运行文件存放地址 events {
} #设定http服务器,利用它的反向代理功能提供负载均衡支持
} |
Beta Was this translation helpful? Give feedback.
-
不对啊,为什么要在 nginx.conf 里 include /usr/local/soft/nginx/conf/.conf; 这不就循环引用了吗 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
这个是参考示例,你要根据实际环境的配置情况,因地制宜。 |
Beta Was this translation helpful? Give feedback.
-
我是centos,按这个说的话,我的确是应该配置的 |
Beta Was this translation helpful? Give feedback.
-
请注意,我们在文档中包含的是 |
Beta Was this translation helpful? Give feedback.
-
请参考 Debian 的结构来修改你的配置目录后才可正常使用: |
Beta Was this translation helpful? Give feedback.
-
好的,谢谢哈。不过我看了https://salsa.debian.org/nginx-team/nginx/-/blob/master/debian/conf/nginx.conf,感觉还是要配置那两句话,依然没看懂。 |
Beta Was this translation helpful? Give feedback.
-
前面那个 issue 中提示不支持 user 指令的原因是重复包含了 nginx.conf 文件,导致第二个 user 指令在 http 块中。user 指令需要在最外层,而且只能有一个。 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
如果不需要配置include /etc/nginx/conf.d/.conf;,但是应该是需要配置include /usr/local/soft/nginx/sites-enabled/*;不然服务启动后,读取不到配置文件 |
Beta Was this translation helpful? Give feedback.
-
此外,你需要把以前写在 nginx.conf 中的 server 块除了最上面默认的块之外,都按 Server Name 分成单个文件放在 sites-available 目录中,这样 Nginx UI 才能对网站进行管理。 |
Beta Was this translation helpful? Give feedback.
-
虽然之前一键安装程序能起来,但是没办法读取配置文件,经过测试,发现配置这句话后include /usr/local/soft/nginx/conf/.conf;
就会报各种问题,按照提示注释后,又会报下一句,反正没完没了。include /usr/local/soft/nginx/conf/.conf;后,一切都正常,眼睛都毛冒金花儿了。
网上也没找到资料,也是严格按照官网https://nginxui.com/zh_CN/guide/getting-started.html这么操作的,但是还是失败。
Beta Was this translation helpful? Give feedback.
All reactions