Having trouble getting this working on NGINX / Flywheel #446
-
Thanks for this fantastic plugin @pfefferle! So excited to use it. :) I’m reaching out to the community here to hopefully get some tips on how to get this working with NGINX, specifically on Flywheel (managed WordPress hosting). I tried to install the ActivityPub and WebFinger plugins and they both appeared to install no problem. I adjusted the ActivityPub plugin settings so that author accounts were disabled and the blog-wide account was enabled, then set the blog profile ID to I then went to Mastodon to search for my blog username (@[email protected]), but it didn’t show up. Likewise for I then checked the Site Health tool and saw the following two errors:
This was sort of understandable since I had author pages disabled via Yoast SEO. I would rather leave them disabled, but I went ahead and enabled them in order to see what would happen to these errors. The Site Health errors still didn’t go away. I then visited After some searching, I came across a few support forum threads that suggested altering the NGINX config. So I asked the Flywheel support team to add the following:
(Which I’m hoping is correct. It seems like the majority of the WordPress install is in a directory above the public folder, in a folder called After this change, if I run
Which doesn’t seem correct, since we need the content-type to be some sort of JSON. This URL on the other hand (which I think that the other URL is supposed to redirect to?) does seem to return the correct JSON, I think: I tried flushing the cache and saving my permalink settings again, no change. I then tried to add And that’s basically where I’m at now. Should I ask them to add Do I need to ask them to disallow caching for any particular URLs? I know that pages and posts are cached for 1 hour, and I think other resources may be cached for up to 365 days. Could the problem be related to the PHP modules that Flywheel does and doesn’t have enabled? More on those here: https://getflywheel.com/wordpress-support/php-on-flywheel/#php-modules Any suggestions are very welcome!! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 17 replies
-
Hey @piperhaywood nice, that you are playing around with the plugin :) Let's see if we can get it to work! WebFingerIt seems that If I call So maybe try using
instead? Accept header/Content negotiationThe second thing is the content negotiation. If your caching mechanism does support content negotiation, it is fine. Then your cache will cache the files based on the Accept header. If not, you should ask for disallowing (at least) the author URLs for the cache. You can check it with
These are the two main requirements to get found on Mastodon. WebFinger and Content Negotiation for profile/author URLs. I am sorry, that it is so complicated! |
Beta Was this translation helpful? Give feedback.
-
Pardon me sticking my nose in here, but I'm just rebuilding my wordpress
and I am having HTML returned by
curl -v -sS -H 'Accept: application/activity+json'
https://alecmuffett.com/article/author/alecm
...too, and for me I have identified the problem as WP-SuperCache (I nuked
the cache and did the above request, and it returned JSON) so I am trying
to work out a way to get SuperCache to ignore "application/activity+json"
requests.
Any ideas?
- alec
|
Beta Was this translation helpful? Give feedback.
-
okay, so I did a var dump to check FPM:
<?php var_export($_SERVER)?>
...and I can guarantee the result includes:
'HTTP_ACCEPT' => 'application/activity+json',
...so I can be certain that the Accept header is making it to the PHP
stack; it seems like WP-SuperCache is ignoring it and treating "all the
world's an HTML object?"
For the moment I have disabled supercache and run my test suite, and with
WPSC off everything now appears to be working OK (although it's not a fully
comprehensive test)
There are various pages online about enabling certain vars in certain code
to disable WPSC; that may or may not be relevant. Another approach might
be to adopt "Advanced" rather than "Simple" caching and use NGINX to avoid
ever returning cached content for other than the appropriate content
accept-types.
But it would be nice to make WPSC a little smarter, if indeed that is where
the problem rests.
- alec
|
Beta Was this translation helpful? Give feedback.
-
@pfefferle what I am suffering isn't (from what I can see) an issue with WP-ActivityPub, but is apparently more with WP-SuperCache not honouring the "Accept" header. Before I go and log an issue with WP-SuperCache, I was wondering if you had had any experience of this issue with WP-SuperCache elsewhere, that I could cite to them, please? |
Beta Was this translation helpful? Give feedback.
-
Hi Jeremy!
I have switched off WPSC for the moment, but I can fairly straightforwardly
re-enable it if you would like to get the results of some tests.
I was running WPSC in simple mode (ie: PHP-based caching) I think pretty
much with defaults for everything else.
I'm happy to go back and reset it to defaults and try once more, but what
else would you want to see in terms of evidence and settings? Screenshots?
Curl dumps?
…On Wed, 25 Oct 2023, 16:27 Jeremy Herve, ***@***.***> wrote:
It has been, yes. That change made it to WP Super Cache on August 16:
https://wordpress.org/plugins/wp-super-cache/#developers
—
Reply to this email directly, view it on GitHub
<#446 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGC4ECNMQWR3QIZQ6Q4AVLYBEVVJAVCNFSM6AAAAAA44Y7J2WVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TGOBSHAYTA>
.
You are receiving this because you commented.Message ID:
<Automattic/wordpress-activitypub/repo-discussions/446/comments/7382810@
github.com>
|
Beta Was this translation helpful? Give feedback.
Another update for posterity:
We got it working, I think!
Ultimately, it seemed like the crux of the issue was the full-page caching.
Flywheel dug a bit further in to Fastly’s documentation (they use Fastly for caching) and found that they could add a
Vary
header to the NGINX config for content negotiation. They did that, and it seemed to start working immediately! Searching for @[email protected] on Mastodon surfaces my blog ActivityPub account (no user accounts because I have those turned off).For future reference, this is the NGINX config tweak that got ActivityPub and Webfinger working on Flywheel with their Fastly caching setup: