[GH-ISSUE #398] [emerg] getpwnam("nginx") failed #337

Closed
opened 2026-02-26 06:32:23 +03:00 by kerem · 8 comments
Owner

Originally created by @alkanna on GitHub (May 7, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/398

Getting this error at nginx start, it breaks websocket support apparently.
Need to manually run useradd nginx in the container to fix the issue.

Originally created by @alkanna on GitHub (May 7, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/398 Getting this error at nginx start, it breaks websocket support apparently. Need to manually run useradd nginx in the container to fix the issue.
kerem 2026-02-26 06:32:23 +03:00
Author
Owner

@jc21 commented on GitHub (May 20, 2020):

So the container starts, even though you saw that error? I'm not seeing it in any of my containers.

Can you mention your docker host operating system?

<!-- gh-comment-id:631431545 --> @jc21 commented on GitHub (May 20, 2020): So the container starts, even though you saw that error? I'm not seeing it in any of my containers. Can you mention your docker host operating system?
Author
Owner

@jonatino commented on GitHub (Aug 28, 2020):

Also had this issue. Installed in unraid as a docker service.

/etc/nginx/conf.d/include # nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [emerg] getpwnam("nginx") failed
nginx: configuration file /etc/nginx/nginx.conf test failed

Had to run
useradd -s /bin/false nginx

<!-- gh-comment-id:682674192 --> @jonatino commented on GitHub (Aug 28, 2020): Also had this issue. Installed in unraid as a docker service. ``` /etc/nginx/conf.d/include # nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: [emerg] getpwnam("nginx") failed nginx: configuration file /etc/nginx/nginx.conf test failed ``` Had to run `useradd -s /bin/false nginx`
Author
Owner

@jonatino commented on GitHub (Aug 28, 2020):

Uninstalled and reinstalled it on Unraid and the same problem happened twice.

It's weird because the control panel loads fine, but none of my proxy hosts worked until I created that user.

<!-- gh-comment-id:683149185 --> @jonatino commented on GitHub (Aug 28, 2020): Uninstalled and reinstalled it on Unraid and the same problem happened twice. It's weird because the control panel loads fine, but none of my proxy hosts worked until I created that user.
Author
Owner

@dextre1480 commented on GitHub (Mar 1, 2021):

hello, I solved with:
useradd -r nginx
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

<!-- gh-comment-id:787740769 --> @dextre1480 commented on GitHub (Mar 1, 2021): hello, I solved with: **useradd -r nginx** nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
Author
Owner

@ikechukwukalu commented on GitHub (Nov 3, 2021):

hello, I solved with: useradd -r nginx nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful

This worked for me

<!-- gh-comment-id:959756119 --> @ikechukwukalu commented on GitHub (Nov 3, 2021): > hello, I solved with: **useradd -r nginx** nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful This worked for me
Author
Owner

@0xzight commented on GitHub (May 6, 2022):

thanks @jonatino
useradd -s /bin/false nginx
its work on me too.

<!-- gh-comment-id:1119473543 --> @0xzight commented on GitHub (May 6, 2022): thanks @jonatino useradd -s /bin/false nginx its work on me too.
Author
Owner

@abuabdirohman4 commented on GitHub (Jul 11, 2022):

solved with run
useradd -s /bin/false nginx
thanks @jonatino

<!-- gh-comment-id:1180163536 --> @abuabdirohman4 commented on GitHub (Jul 11, 2022): solved with run `useradd -s /bin/false nginx` thanks @jonatino
Author
Owner

@smilad commented on GitHub (May 23, 2023):

alpine use adduser instead useradd

<!-- gh-comment-id:1558626353 --> @smilad commented on GitHub (May 23, 2023): alpine use `adduser` instead useradd
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#337
No description provided.