The background,

The front-end and back-end are deployed on different servers. The front-end server uses Nginx as a reverse proxy to access the back-end, but error 404 is reported on some interfaces, as shown in the figure:

Second, the reason why

Data set PID86.10358.231/ Fb514791-87E0-4168-8500-FF8d05ADD62C, contains the special character “/”,

In the absence of a proxy, the front end escapes the special character “/” to “%2F”, producing the URL:

http://202.38.77.91/api/v3/Datasets/86.10358.231%2Ffb514791-87e0-4168-8500-ff8d05add62c/thumbnail
Copy the code

But Nginx intercepts the URL, and when reverse proxy, interprets the escape character, the URL becomes:

http://192.168.123.21:3000/api/v3/Datasets/86.10358.231/fb514791-87e0-4168-8500-ff8d05add62c/thumbnail
Copy the code

The back-end didn’t appear the interface http://192.168.123.21:3000/api/v3/Datasets/86.10358.231/, 404 error.

Third, solve

You need to add a special interception rule to the Nginx configuration file:

The location/API/v3 / Datasets / 86.10358.231 /} {proxy_pass http://192.168.123.21:3000/api/v3/Datasets/86.10358.231%2F/Copy the code

Four,

This is by no means universal, just for the record.