Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Activitypub plugin: how to configure the redirection ? #61

Open
lapineige opened this issue May 6, 2019 · 8 comments · May be fixed by #231
Open

Using Activitypub plugin: how to configure the redirection ? #61

lapineige opened this issue May 6, 2019 · 8 comments · May be fixed by #231

Comments

@lapineige
Copy link
Member

Hello,

While trying to use the plugin Wordpress ActivityPub, I'm in trouble with the redirection to .well-known and nginx config. See Automattic/wordpress-activitypub#37

My wordpress is in a subfolder (let's call it subdirectory). So I tried to add rewrite ^/.well-known/ ^/subdirectory/.well-known/ last; in /etc/nginx/conf.d/domain.tld.conf.

A webfinger test (https://client.webfinger.net/lookup?) show me that it returns a text/html file. I'm pretty sure it's yunohost SSO page.

Should I exclude it from SSO ? How can I do that ?

@maniackcrudelis
Copy link

You can add a skipped_regex to your wordpress to let this url pass through the sso.

ynh_app_setting set wordpress skipped_regex "domain.tld/path_url"

@lapineige
Copy link
Member Author

lapineige commented May 6, 2019

I tried with domain.tld/.well-known and domain.tld/subdirectory/.well-known, same result :(

edit: domain.tld/.well-known redirect to the SSO, domain.tld/subdirectory/.well-known to wordpress, page not found.

@maniackcrudelis
Copy link

You should probably replace the - by a ., that's a regex.

Anyway, I can help you using YunoHost cli command, but I can't explain you how to use that plugin.

@lapineige
Copy link
Member Author

Ok thanks.

No problem, I was thinking that yunohost SSO could have been a problem.

@lapineige
Copy link
Member Author

lapineige commented May 8, 2019

For the record: for nextcloud this text/html page is just a missing resource (see: YunoHost-Apps/nextcloud_ynh#198) while for wordpress it's really the SSO.
I'll check my regex, it might be wrong.

edit: I fixed the regex, same "missing resource".

@lapineige
Copy link
Member Author

lapineige commented May 8, 2019

Ok, I found the solution, the redirection wasn't good.

Here is the solution: change /etc/nginx/conf.d/domain.d/wordpress.conf and and this :

location /.well-known/ {
        return 301 https://$server_name/YourSubFolder/$request_uri;
}

(Automattic/wordpress-activitypub#37 (comment))

@lapineige
Copy link
Member Author

For the record, upgrading wordpress via Yunohost remove the changes in Nginx file (they are backups in /home/yunohost.conf/backup/etc/nginx/conf.d/domain.tld.conf/wordpress.conf.backupDATE).

@lapineige
Copy link
Member Author

I've seen this error again today, with Wordpress Health check saying that the WebFinger endpoint is not accessible, and it not replying with a valid JSON.
Indeed, it gets SSOed.

Adding the previously mentioned (#61 (comment)) Nginx conf lines fixed it.
I'll make a PR.

@lapineige lapineige reopened this Dec 17, 2023
lapineige added a commit to lapineige/wordpress_ynh that referenced this issue Dec 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants