macOS uses nginx proxy upload error open() "/usr/local/var/run/nginx/client_body_temp/0000000069" failed (13: Permis

When using Nginx to upload files under macOS system, you may encounter the following error message:

open() "/usr/local/var/run/nginx/client_body_temp/0000000069" failed (13: Permission denied)

This error means that Nginx cannot open the temporary file in the specified path because of insufficient permissions. To fix this, you can follow these steps:

  1. Open the Terminal application.

  2. Execute the following command to set the permissions of the temporary file directory to writable:

sudo chmod -R 777 /usr/local/var/run/nginx/client_body_temp

This grants read, write, and execute permissions to all users of the directory and its subdirectories. Please note that this may have some impact on the security of the system. In a production environment, use this permission setting with caution.

  1. Restart the Nginx service for the changes to take effect. Execute the following command:
sudo nginx -s reload

This will restart the Nginx service and load the new configuration and permission settings.

Now, Nginx will be able to create and open files in the temporary files directory, which resolves permission issues when uploading files.

Note that this workaround is only suitable for solving permission issues during file upload. In a production environment, it is recommended to use stricter and more secure permission settings to ensure server security.

Guess you like

Origin blog.csdn.net/qq_39997939/article/details/131670826