Non-root Web Path

When installing FastCGI applications in non-root web path (for example, http://example.com/thisapp/), some of them expect (and find sufficient) couple fastcgi parameters to be present: PATH_INFO and SCRIPT_NAME, set in a similar way to how Apache sets them.

つまり、Apacheでは FastCgiExternalServer /var/www/thisapp -socket /path/to/thisappfcgi.sock のようなものが、NGINXは以下の方法で行うことができます:

location ~ /thisapp(?<path_info>/.*|$) {
  fastcgi_pass    unix:/path/to/thisappfcgi.sock;
  include /etc/nginx/fastcgi_params;

  fastcgi_param   PATH_INFO   $path_info;
  fastcgi_param   SCRIPT_NAME "/thisapp";
}

少なくともMercurial, Trac およびZope via FastCGIでは動作することが知られています。

TOP
inserted by FC2 system