nginx: [emerg] unknown directive "?#upstream"
This problem occurs because of the modularization of nginx, and some online browsing errors of this problem say that there are missing plug-ins, and some say that the format is incorrect.
The way to troubleshoot this problem is
-
Check if the configuration format is correct
-
Check whether the configuration content is correct
-
Check plugin
-
If the above troubleshooting is OK, you can try to make a copy of the nginx.conf file, rename and replace the content with your configuration. It might be a file encoding issue. . . .
I solved it by the 4th method