Home > Operation and Maintenance > Nginx > How to solve the image access 404 problem after Nginx image server configuration

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2023-05-19 11:22:06
forward
4227 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:
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
Latest Issues
Error restarting nginx
From 1970-01-01 08:00:00
0
0
0
server - Nginx configuration webapp problem
From 1970-01-01 08:00:00
0
0
0
Nginx default.conf problem
From 1970-01-01 08:00:00
0
0
0
centos7 - NGINX exception occurs
From 1970-01-01 08:00:00
0
0
0
nginx load balancing
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template