MAMP nginx.conf - invalid number of arguments in "user"

I am having issues starting up Nginx with the MAMP Pro application.

When I press start Nginx I get the following error message

invalid number of arguments in "user" directive in /Library/Application Support/appsolute/MAMP PRO/conf/nginx.conf:7

looking at the configuration file

/Library/Application Support/appsolute/MAMP PRO/conf/nginx.conf

I notice the following line has multiple users

user rob COMPANYWORKDOMAIN\Domain Users;

However changing it to just one user (rob) does not work because it gets overwritten and reverted back next time I start up Nginx via the MAMP application.

I'm a bit stuck as what to do here?


Solution 1:

Your host is part of the domain COMPANYWORKDOMAIN and user rob is a domain user (probably admin, network, managed) but no local admin user.

nginx.conf line 7 is determined by the "Run server as:" settings in MAMP Pro and mustn't be edited manually:

enter image description here

Since your user is no local admin account using rob will fail.

So either use the standard Unix users (www/www) or a local admin account (which requires to log out as rob and log in as another local admin user) to run MAMP Pro:

enter image description here

Solution 2:

I ran across this error, and the issue turned out to be that there were spaces in the group name. I fixed this by going to File -> Edit Template -> Nginx (nginx.conf) and putting double quotes around MAMP_Group_MAMP (should be around line 7, or you can just search for it).