The server environment is the LNMP environment,
the computer is the LAMP environment,
The picture directory is a sibling directory of public;
The image path can be displayed on the local machine, but when placed on the server, external access cannot display the image, unless I set the default access path of nginx to the public superior directory, but in this case, the css style path is Something went wrong;
The path of the picture is www.xxx.com/../uploads/asdads.jpg
or something like this.
There is no problem in the LAMP environment, but it will not work in the server. What is the problem?
I suspect that nginx settings are missing. So I wanted to ask.
The path is fine on this machine. I found that when the browser accesses the server, it seems to ignore ../. I have placed the save folder in the public directory.
怪我咯2017-05-16 13:05:33
Based on your description, I guess there is something wrong with the path settings. You can use the development mode in the browser to see where the paths of the images and Js point to respectively, and whether they are the same as you expected.
给我你的怀抱2017-05-16 13:05:33
First check whether the uploads directory has read and write permissions. Secondly, if it is ignored, try the absolute path?
世界只因有你2017-05-16 13:05:33
Confirm whether the file name is correct
Public files can directly specify the absolute path in nginx
server {
#忽略部分代码
location /public/ {
alias "D:/www/code/public/";
}
location / { ... }
#忽略部分代码
}