server { location /api { uwsgi_pass 127.0.0.1:3031; include uwsgi_params; } location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } }