assemblee-virtuelle / wp-ldp

LDP Plugin for wordpress
Other
19 stars 2 forks source link

Presentation of PoC not working with Nginx #81

Open Vidyut opened 6 years ago

Vidyut commented 6 years ago

My server shows a page not found for the url. For example https://aadhaar.fail/ldp#https://aadhaar.fail/api/ldp/v1/person/nandan-nilekani/ if you get the data using curl, you see that the json is indeed generated. It does not process the # followed by the PoC url. I was stumped till I checked the servers for balessan.me and www.virtual-assembly.org - both return Apache in their header. That gave me a starting point. Will share back any fixes I find.

Vidyut commented 6 years ago

The following code needs to be added to the server block for Nginx (wp-ldp/front should be replaced by whatever frontpage url is set in the code of the plugin.

location /wp-ldp/front { try_files $uri $uri/ /wp-content/plugins/wp-ldp/public/index.php?q=$uri&$args; } However, the presentation continues to fail. Will investigate. At first look, it appears that the plugin isn't loading things right.

If I may ask, why not use the standard custom post type to publish the presentation and link to the json from the header?

balessan commented 6 years ago

In the documentation I assumed (it's written as is) people were using Apache, as I have never used Nginx myself I did not want to lose time offering extensive documentation on this side.

Your issue could be a permalink issue. Have you tried go to the permalink settings and save it back ?

We implemented this plugin as a Proof on concept to answer to custom ontologies so we did not want to use default post types at first. Indeed I now think it was a complication for nothing.

I'd really like to use the default users and posts/pages objects and only exposing proper API. I also like the idea of choosing which post type you would like to associate with any "resources", as proposed in #80

Vidyut commented 6 years ago

I played with permalinks. Wasn't a permalinks issue. Then got busy with something else and haven't been able to go back and figure this out.

Using standard post types would be a good idea - even if we can move to them now. Many things will then work out of the box, compatibility with other plugins will also be predictable, etc.

balessan commented 6 years ago

Yeah sure. I wasn't that expert of wordpress when I started this plugin project. Makes more sense now :-)