I want to run both WordPress and YOURLS on one domain.
Since both need to handle URLs differently, they need different try_files directives. WordPress sits on the root of the domain (domain.tld), while YOURLS is being installed to the /go/ directory.
Despite the two location rules, I get 404s on any links generated by YOURLS (e.g. domain.tld/g/linkname, all are redirects to external URLs), though I can access the YOURLS admin backend.
As far as I read, declaring to location rules (one for /go/, and one for /) should suffice in order to let Nginx handle the direct and the /go/ URLS differently - is there something in wrong in my thinking?
I have added the following to the Nginx config:
location / {
try_files $uri $uri/ /index.php?$args;
}
location /go/ {
try_files $uri $uri/ /go/yourls-loader.php$is_args$args;
}
What am I missing?
Not sure if it will be of direct help to you or not. I was trying to do a similar configuration using a subdirectory pointing to yourls docker After many hits and trials, the following settings have worked for me. Maybe some part of it might be useful for someone.
PS: I know if is evil and please add proxy headers as per your need!