Skip to content

Instantly share code, notes, and snippets.

@joar
Last active December 11, 2015 16:28
Show Gist options
  • Save joar/4627472 to your computer and use it in GitHub Desktop.
Save joar/4627472 to your computer and use it in GitHub Desktop.
Host MediaGoblin in a subdirectory
server {
# [...]
# Your regular MediaGoblin nginx configuration settings
# [...]
# Mounting MediaGoblin via FastCGI.
location /MEDIAGOBLIN_SUBFOLDER/ {
fastcgi_pass 127.0.0.1:26543; # The address of the MediaGoblin FastCGI server
include /etc/nginx/fastcgi_params;
# our understanding and nginx's handling of 'script_name' and
# 'path_info' does not match, so this is where we tell nginx
# how we like it
fastcgi_split_path_info ^((?U)/MEDIAGOBLIN_SUBFOLDER/)(.+)$;
fastcgi_param PATH_INFO /$fastcgi_path_info;
fastcgi_param SCRIPT_NAME "/MEDIAGOBLIN_SUBFOLDER/";
# Please replace all MEDIAGOBLIN_SUBFOLDER and replace them with the
# subfolder path.
# If your desired path is: "http://localhost/mediagoblin/" then your
# replacement is "mediagoblin" without the quotes.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment