title: can't see fastAPI documentation with 2 main.py and 1 nginx reverse proxy
body: <p>I'm using fastAPI together with nginx, as a reverse proxy. I split APIs into 2 different main.py with different endpoints:</p>
  <ul>
  <li>main.py -&gt; main location/endopoint of APIs: <code>/</code>  (port 5010)</li>
  <li>main_slow.py -&gt; main location/endopoint of APIs: <code>/slow_api</code>  (port 5011)</li>
  </ul>
  <p>to run them on different ports (5010,5011). This because one API is very slow and requesting APIs in series i need one to be separate from the others (in main_slow.py). Using nginx as a reverse proxy, I can call the APIs with their own endpoints under a single port (8000), then nginx will take care of passing them to the correct port of fastAPI.</p>
  <p>All works well, the only problem is that i can't see all API documentations in /docs, but only endpoints of the first main.py (location <code>/</code>).</p>
  <p>in <code>/nginx/conf.d/</code> i have <code>py_api.conf</code> and i have configured it like this:</p>
  <pre><code>server {
  
          listen 8000;
  
          location / {
  
                  proxy_redirect off;
                  proxy_set_header Host $host;
                  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  
                  proxy_http_version 1.1;
                  proxy_set_header Connection &quot;&quot;;
  
                  add_header 'Access-Control-Allow-Origin' '*';
                  add_header 'Access-Control-Allow-Methods' 'GET, POST, PATCH, PUT, DELETE, OPTIONS';
                  add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,Origin,X-Auth-Token';
                  add_header 'Access-Control-Allow-Credentials' 'true';
  
                  if ($request_method = OPTIONS ) {
                          return 200;
                  }
  
                  proxy_pass http://localhost:5010;
                  proxy_set_header Connection &quot;Keep-Alive&quot;;
                  proxy_set_header Proxy-Connection &quot;Keep-Alive&quot;;
  
                  auth_basic &quot;Restricted&quot;;                                #For Basic Auth
                  auth_basic_user_file /etc/nginx/.htpasswd-pyapi;  #For Basic Auth
          }
          location /slow_api{
  
                  proxy_redirect off;
                  proxy_set_header Host $host;
                  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  
                  proxy_http_version 1.1;
                  proxy_set_header Connection &quot;&quot;;
  
                  add_header 'Access-Control-Allow-Origin' '*';
                  add_header 'Access-Control-Allow-Methods' 'GET, POST, PATCH, PUT, DELETE, OPTIONS';
                  add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,Origin,X-Auth-Token';
                  add_header 'Access-Control-Allow-Credentials' 'true';
  
                  if ($request_method = OPTIONS ) {
                          return 200;
                  }
  
                  proxy_pass http://localhost:5011;
                  proxy_set_header Connection &quot;Keep-Alive&quot;;
                  proxy_set_header Proxy-Connection &quot;Keep-Alive&quot;;
  
                  auth_basic &quot;Restricted&quot;;                                #For Basic Auth
                  auth_basic_user_file /etc/nginx/.htpasswd-pyapi;  #For Basic Auth
          }
  }
  
  </code></pre>
  <p>Did I do something wrong to be able to see the documentation of both locations? Or do I have to do something about python and fastAPI?</p>
  <p>SOLVED</p>
  <p>To see all two documentation (for now in two different path) i added in my fastAPI project main_slow.py</p>
  <pre><code>app = FastAPI(  title='slow API',
                  docs_url='/slow_api/docs', 
                  redoc_url='/slow_api/redoc',
                  openapi_url='/slow_api/openapi.json')
  </code></pre>
  <p>instead only</p>
  <pre><code>app = FastAPI()
  </code></pre>