nginx displays 500 Internal Server Error solution after deploying vue

Deploying the Vue front-end project today has been reporting an error of 500 and the main page cannot be displayed.
insert image description here

One thought that his dist location was not accessed correctly or the location of nginx.conf was written incorrectly, and finally found out! It's a question of permissions! !
I want to access the address of /home/ubuntu/myapp/ruoyi/ruoyi-ui/dist, and there is no problem in writing the path.
insert image description here
Finally, when I saw the information in the error.log, I suddenly realized that it was a permission problem.
insert image description here

This is really pitiful.
The default permission settings in nginx.conf are as shown in the figure, on the first line! ! is commented out, then the default means that there is no permission . . So can't access.
insert image description here
All you need to do is set the permissions to root and you're done!

insert image description here
The front-end page can finally be accessed normally! ! ! It's not easy!insert image description here

Guess you like

Origin blog.csdn.net/changyana/article/details/123453755