1 thought on “nginx: [emerg] invalid number of arguments in “return” directive in

  1. Keir Finlow-Bates

    In my return server block I’d accidentially inserted a space in the redirect URL.

    So I had:

    server {
    server_name .mydomain.net;
    return 301 $scheme://mydomain.com $request_uri;
    }

    Once I removed the space between .com and $request_uri; it worked. Took me a while to spot the errant space though.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *