How to solve the image access 404 problem after Nginx image server configuration

WBOY
Release: 2023-05-19 11:22:06
forward
4116 people have browsed it

My wrong configuration is:

How to solve the image access 404 problem after Nginx image server configuration

Server file root address:

How to solve the image access 404 problem after Nginx image server configuration

I want to enter this through the browser The image is accessed at the address:

How to solve the image access 404 problem after Nginx image server configuration

However, you will find that the file cannot be found and it will always 404. The reason is that the root path configuration is wrong. Let’s take a look at the principle of the root path:

## The #root configuration means that the URL will be followed by the directory configured by root to form the corresponding file path.

means that the address we enter in the browser actually accesses

/home/ftpuser/images/images/~~~

The /images behind our location will be spelled to the actual access path.

There are two processing methods:

1. The processing method is to remove the images behind root. As follows:

How to solve the image access 404 problem after Nginx image server configuration

#In this way, you can access the image by entering the address before entering it in the browser~~~~~~~~~~~~~~~~~

2. The second solution is to use alias to configure the access path

How to solve the image access 404 problem after Nginx image server configuration

The above is the detailed content of How to solve the image access 404 problem after Nginx image server configuration. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!