How does web server know that it has to send the request to the app server and static files? How does web server know that it has to send the request to the app server and static files? flask flask

How does web server know that it has to send the request to the app server and static files?


So, in you example you have file style.css in static folder. For now the static file is serve from flask web server app not from the nginx. The question is how to serve static file in flask from nginx right ?

  1. first, you create a location block for webapp/static in nginx configuration file
location /webapp {  proxy_pass http://127.0.0.1:6969;}location /webapp/static {  alias /path/to/webapp/static;}
  1. And set static_url_path for each webapp: app = Flask(name, static_url_path="/webapp")