nginx - debian 8 上 nginx 中的用户 'nginx' 在哪里

标签 nginx load-balancing

我在 Debian 7 (wheezy) 上安装了 nginx 1.6.0,现在我想在 Debian 8 (Jessie) 上安装 nginx。这个新 nginx 的版本是1.6.2。我将旧版本的配置文件 nginx.conf 复制到新服务器,但是当我尝试启动服务时,它失败了:

service nginx restart

输出:

nginx nginx[10743]: nginx: [emerg] getpwnam("nginx") failed in /etc/nginx/nginx.conf:1

我知道我的问题是 nginx.conf 中的第一行:

user    nginx;

我也知道,如果我将此行更改为user www-data,问题就会消失,但为什么会这样呢?我还使用 nginx 作为负载均衡器而不是网络服务器。

最佳答案

$ man getpwnam

The getpwnam() function returns a pointer to a structure containing the broken-out fields of the record in the password database (e.g., the local password file /etc/passwd, NIS, and LDAP) that matches the user‐ name name.

用户nginx不存在。您可以创建它,也可以仅使用 www-data 作为用户。

关于nginx - debian 8 上 nginx 中的用户 'nginx' 在哪里,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32022294/

相关文章:

nginx - NGINX可以根据IP选择proxy_pass后端吗?

shell - 从 bash 脚本文件运行 docker-compose

proxy - nginx 将所有流量代理到远程 nginx

azure - 我们可以在azure中的两个应用程序服务上使用负载均衡器吗

amazon-web-services - 当流量通过 AWS Application Load Balancer 时访问主机名

wordpress - 我们可以将 nginx 同时用于 WordPress 和 Drupal 吗?

docker - nginx docker proxy_path到服务器中另一个docker的路径

http - 在 HAProxy 中基于源 IP 路由 HTTP

amazon-ec2 - Amazon EC2 中的负载均衡?

load-balancing - Istio DestinationRule 如何与 Kubernetes Service 相关?