Problem Description:
In the run locally flask project, when you run this code to the following, normal redirection
return redirect(url_for('.script_case'))
But after project deployment to the server code runs a phrase, but reported a 404 Not Found
problem analysis:
Carefully read the url is no port number.
the correct address:
http://10.2.1.92:8001/script_case
Actually requested address:
Solving steps:
Find nginx configuration file
[root@67 ~]# find / -name nginx.conf
/etc/nginx/nginx.conf
Edit the nginx configuration file
nano /etc/nginx/nginx.conf
Nginx running port number specified
Test modification
sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Restart nginx Service
systemctl restart nginx.service
Reference documents:
flask url_for Image URL missing port number