Missing equivalent to aliases

Hi again,

i tried to get my Mediagoblin work with Caddy but without success yet.

It should be like:

 location /plugin_static/ {
    alias /var/www/mediagoblin/user_dev/plugin_static/;
 }

But the only thing i found in the docs was a rewrite.
Am i forced to play around with subdomains? :cold_sweat:

kind Regards


Edit: is just saw the following in the FAQ:

yoursite.com/path/ {
    ...
}

But how to deal with it with two primary domains as there are temporally now?

Not sure I understand this question, sorry.

To get this working you’d have a Caddyfile like this:

example.com {
    root /var/www/html
    ...
}
example.com/path/ {
    root /some/other/path
    ....
}

And you’d need to duplicate across any directives from the main vhost that are also applicable to the more specific location, such as fastcgi directives, security rewrites, etc…

Thank you very much for pointing out, it is to “that” beautiful syntax but it works like a charm. :heart:

[details=Solved problem i wrote and found the solution few seconds later]

I just dropped the php part from the fastcgi line xD

It sadly looks like my problems are not solved at this point, i don’t get over a 404. :frowning:

The nginx conf would look like:

...
include /etc/nginx/mime.types;
default_type  application/octet-stream;
sendfile on;
...
location / {
   fastcgi_pass 127.0.0.1:26543; # this is mediagoblin itself
   include /etc/nginx/fastcgi_params;
   fastcgi_param PATH_INFO $fastcgi_script_name;
   fastcgi_param SCRIPT_NAME "";
}

My current caddyfile looks like this (i guess i have to add all possible mime types per hand there too right? I left this out because i thought it is medium priority):

media.illuna-minetest.tk { #this explains your question, we may migrate to a new domain
                           #and for now i added it for all services as a second domain
                           #so people ingame have less to type - in this case i decided
                           #to just serve the goblin from the new domain
        redir https://media.illuna.rocks{uri}
}

media.illuna.rocks {
        log /var/log/caddy/goblin_access.log
        root /var/www/mediagoblin/mediagoblin/ #this folder does not include html
                                               #or php files, not sure why the docs
                                               #are pointing to it
        errors /var/log/caddy/goblin_errors.log
        fastcgi / 127.0.0.1:26543 php # this is mediagoblin itself
}

media.illuna.rocks/mgoblin_static/ {
        root /var/www/mediagoblin/mediagoblin/static/
}

media.illuna.rocks/mgoblin_media/ {
        root /var/www/mediagoblin/user_dev/media/public/
}

media.illuna.rocks/theme_static/ {
        root /var/www/mediagoblin/user_dev/theme_static/
}

media.illuna.rocks/plugin_static/ {
        root /var/www/mediagoblin/user_dev/plugin_static/
}
```[/details]

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.