Help with Wordpress fediverse integration

Hi folks, can anyone help me figure out how to make a wordpress blog integrate with the fediverse? My posts are not visible and post author is not detectable on either Pixelfed or Mastodon.
I have installed the Activitypub and Webfinger plugins and activated them within my Wordpress Network Admin dashboard and website dashboard. I have added Wordpress as a permission for visitors in YUNOhost web admin and the website is visible.
Is there something I am missing?
The Activitypub developer FAQ says that if the blog is run in a subdirectory, ‘in order for webfinger to work, it must be mapped to the root directory of the URL on which your blog resides.’ I have tried to follow these instructions:

But when I rummage via SSH /etc/nginx/sites-available does not contain a ‘site.conf’ file for me to edit. Should I create one? And how do I know if my blog is in a subdirectory?
I know that others have been able to integrate their Wordpress sites with Activitypub and post to the fediverse, so it should be possible. Also to note is that my writefreely instance is integrating with the fediverse out of the box, so I don’t think there is anything in my YUNOhost install or admin settings which is preventing Wordpress from integrating.
I’m confused and any guidance would be very welcome.
Thanks

YUNOhost version: 11.0.10.2
Running on bought VPS
My skill/experience level: Noob/steep end of the learning curve

Your nginx conf is in /etc/nginx/conf.d/wordpress.domain.tld.d/wordpress.conf, here if I install the worpress app in wordpress.domain.tld path…

I have try install also wordpress with my_webapp app, it needs change some lines on nginx to work, I have added these lines

 # Remove index.php from URL
    if (!-e $request_filename)
     {
     rewrite ^(.*)$ /index.php?q=$1 last;
     }
    
    # increase upload limit size _RR
    client_max_body_size 256M;

and also edited to better performance in /etc/php/8.0/fpm/pool.d/my_webapp.conf

[my_webapp]

user = my_webapp
group = my_webapp

chdir = /var/www/my_webapp

listen = /var/run/php/php8.0-fpm-my_webapp.sock
listen.owner = www-data
listen.group = www-data

pm = ondemand
pm.max_children = 32
pm.max_requests = 500
request_terminate_timeout = 1d


pm.process_idle_timeout = 10s

; Additional php.ini defines, specific to this pool of workers._RR

php_admin_value[upload_max_filesize] = 512M
php_admin_value[memory_limit] = 2048M
php_admin_value[post_max_size] = 512M
php_admin_value[upload_max_filesize] = 512M
php_admin_value[max_input_time] = 360
php_admin_value[max_execution_time] = 360
php_admin_value[max_input_vars] = 2000000
php_admin_value[upload_tmp_dir] = /var/www/my_webapp/www/wp-content/tmp/

@rodinux, thanks for your reply.
To clarify; do you mean that if I edit /etc/nginx/conf.d/wordpressblogsubdomain.nohost.me.d/wordpress.conf, it is the same as

Add the following to the site.conf in sites-available:

location ~* /.well-known {
    allow all;
    try_files $uri $uri/ /blog/?$args;
}

Where ‘blog’ is the path to the subdirectory at which your blog resides.

?

I have tried this but it has not solved the problem.
Many thanks for your help

yes, but I am not sure about what you need to add…

your wordpress.conf must be something like this (perhaps different because here it is a multiple sites)

f (!-e $request_filename) {
	rewrite /wp-admin$ $scheme://$host$uri/ permanent;
	rewrite ^/blog(/[^/]+)?(/wp-.*) /blog$2 last;
	rewrite ^/blog(/[^/]+)?(/.*\.php)$ /blog$2 last;
}

 rewrite ^/blog$ /blog/ permanent;
location /blog/ {

       # Path to source
       alias /var/www/wordpress/;

       index index.php;
       if (!-e $request_filename)
       {
              rewrite ^(.+)$ /blog/index.php?q=$1 last;
       }

       client_max_body_size 30m;
       location ~ [^/]\.php(/|$) {
           fastcgi_split_path_info ^(.+?\.php)(/.*)$;
           fastcgi_pass unix:/var/run/php/php8.0-fpm-wordpress.sock;

           fastcgi_index index.php;
           include fastcgi_params;
           fastcgi_param REMOTE_USER $remote_user;
           fastcgi_param PATH_INFO $fastcgi_path_info;
           fastcgi_param SCRIPT_FILENAME $request_filename;
       }

  # Include SSOWAT user panel.
  include conf.d/yunohost_panel.conf.inc;
}

You have an example with nextcloud.conf in yunohost, it begin like this:

location ^~ /.well-known {
  # The following 6 rules are borrowed from `.htaccess`

  # The following 2 rules are only needed for the user_webfinger app.
  # Uncomment it if you're planning to use this app.
  #rewrite ^/\.well-known/host-meta\.json  /nextcloud/public.php?service=host-meta-json  last;
  #rewrite ^/\.well-known/host-meta        /nextcloud/public.php?service=host-meta       last;

  location = /.well-known/carddav     { return 301 /subpath/remote.php/dav/; }
  location = /.well-known/caldav      { return 301 /subpath/remote.php/dav/; }

  location = /.well-known/webfinger     { return 301 /subpath/index.php$uri; }
  location = /.well-known/nodeinfo      { return 301 /subpath/index.php$uri; }

  try_files $uri $uri/ =404;
}

 rewrite ^/subpath$ /subpath/ permanent;
location ^~ /subpath/ {
[...]

So perhaps for your wordpress only add this at the top what you say

location ~* /.well-known {
    allow all;
    try_files $uri $uri/ /blog/?$args;
}

I am not sure it would be the good way, it is hard for me understand nginx… but you can try.

to test nginx configurations:
nginx -t
don’t forget restart nginx afters modification… perhaps make a copy before of your conf before editing mv /etc/nginx/conf.d/wordpress.domain.tld.d/wordpress.conf /etc/nginx/conf.d/wordpress.domain.tld.d/wordpress.conf.bkp if need to come back to initial…

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