If you have been wondering how to host your GNU MediaGoblin instance anwhere else than your domain's root path /, here's how:

  1. server {
  2. # [...]
  3. # Your regular MediaGoblin nginx configuration settings
  4. # [...]
  5. # Mounting MediaGoblin via FastCGI.
  6. location /MEDIAGOBLIN_SUBFOLDER/ {
  7. fastcgi_pass 127.0.0.1:26543; # The address of the MediaGoblin FastCGI server
  8. include /etc/nginx/fastcgi_params;
  9. # our understanding and nginx's handling of 'script_name' and
  10. # 'path_info' does not match, so this is where we tell nginx
  11. # how we like it
  12. fastcgi_split_path_info ^((?U)/MEDIAGOBLIN_SUBFOLDER/)(.+)$;
  13. fastcgi_param PATH_INFO /$fastcgi_path_info;
  14. fastcgi_param SCRIPT_NAME "/MEDIAGOBLIN_SUBFOLDER/";
  15. # Please replace all MEDIAGOBLIN_SUBFOLDER and replace them with the
  16. # subfolder path.
  17. # If your desired path is: "http://localhost/mediagoblin/" then your
  18. # replacement is "mediagoblin" without the quotes.
  19. }
  20. }