nkanaev / yarr

yet another rss reader
MIT License
3.02k stars 225 forks source link

Cannot Selfhost Behind Nginx: Consistent 404 & 403 Errors #104

Closed JosephReza closed 2 years ago

JosephReza commented 2 years ago

Hello,

I hope this finds you well. I followed the guide here - https://github.com/LukeSmithxyz/landchad/pull/188/commits/585083b68608134d44a5a50d8f64b2c0c6ac8a31 - with little changes outside of the port being 7080 instead of 7070 and usernames etc. being changed. I also tried compiling it myself to no avail. I am also hosting this on Ubuntu 22.04 instead of Debian as the guide would suggest, though this shouldn't make a difference, and I am using the latest version of yarr.

Initially, the static contents did not load. This was due to yarr trying to find them in ./static/. I could not replicate this error when I used it on a local Linux desktop and just used localhost on that - the binary that I downloaded simply worked out of the box. This appeared to be hardcoded to me, and it led me to believe there was an nginx issue.

As a result, I tried copying the static files to its own directory in /opt/yarrstatic and decided to change the nginx root to this directory. This did work in loading static content, but I then consistently got 403s with directories that I had to make or 404s when they didn't exist.

I tried everything - changing file/directory permissions, changing file/directory owners, turning on autoindex, reinstalling HTTPS, etc.. I simply could not fix the issue and I'm fairly convinced its an nginx issue but I'm just not sure.

If there's any other information you would like me to attach please let me know. I would really like to set this up for myself.

Here are the errors: When I am able to log in

When I try to import a feed and have created all the required directories

EDIT: Also worth noting that I did try the supervisord guide in this project's wiki and it did not work either.

nkanaev commented 2 years ago

Hi

/static is served by the binary server itself, and overriding it is not advised. The tutorial seems pretty straightforward, and I was able to replicate it (the server & nginx part).

I'd assume there might an issue with your local setup (firewall/nginx etc). Sorry, I can't help you with that.

JosephReza commented 2 years ago

Hello,

I was able to fix the issue and it was my mistake, not yours, with a very small detail. I sincerely apologize for not looking more carefully.