title: How to make HTTP request to PHP-FPM using Unix socket rather than TCP/IP stack?
body: <p>My web stack is Ubuntu Linux - Nginx - PHP-FPM - Postgres...  On that one server I have a Python application talking to the same database and sharing data with my web application which has a PHP API.</p>
  
  <p>At the moment I am talking to the database directly from Python but this means coding all my database communication logic twice.  It would be nice just to make HTTP requests from Python to the application's PHP API.</p>
  
  <p>I could do something like:</p>
  
  <pre><code>POST http://localhost/my-app/foo [...]
  </code></pre>
  
  <p>but there would an an overhead in using TCP/IP.  Is there a way I can make HTTP requests straight to a PHP-FPM socket or create a unix socket which routes requests to Nginx?</p>
  
  <p>Something like...</p>
  
  <pre><code>POST fastcgi://unix:/var/run/php5-fpm.sock/my-app/foo [...]
  </code></pre>