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

404 for /srv/ #21

Closed
tofuSCHNITZEL opened this issue Aug 28, 2017 · 6 comments
Closed

404 for /srv/ #21

tofuSCHNITZEL opened this issue Aug 28, 2017 · 6 comments

Comments

@tofuSCHNITZEL
Copy link

I use nginx and I get a 404 when calling https:///srv/....... regular short urls work fine...
maybe there is a problem with the symlinks? I checked them and they point to the correct files.

@joshp23
Copy link
Owner

joshp23 commented Aug 29, 2017

Are you getting the 404 when trying to visit an image url or the naked url itlsef?

Currently, navigating directly to https://whatever.tld/srv/ should yield FAIL: missing id. If this is not the case then I would check:

  • permissions (of the cache directory and the linked files themselves and parent folders)
  • symlinks (perhaps just copy the file over to pages/)

I am wondering if you added a preceding and/or trailing slash to your cache location setting in the admin page? Go to https://whatever.tld/admin/plugins.php?page=iqrcodes#stat_tab_options and look at the cache location setting, make sure there is no proceeding or trailing slash.

Other than that, I would need more information.

@tofuSCHNITZEL
Copy link
Author

Both:
e.g. this url gives me an 404:
https://dom.tld/srv/?id=iqrcodes&key=9ada5c024108cc4c72718aa2a7810811&fn=qrc_785f4f42e774d3e54bba057f1d60414a.png

also calling https://dom.tld/srv/ -> 404
calling https://dom.tld/pages/srv.php?id=iqrcodes&key=9ada5c024108cc4c72718aa2a7810811&fn=qrc_785f4f42e774d3e54bba057f1d60414a.png gives me "FAIL: bad access key"

permissions are ok.
I created the symlink like this:
ln -s /httpdocs/user/plugins/iqrcodes/assets/qrchk.php /httpdocs/pages/qrchk.php
(also for srv)

no slashes at the beginning or end of cache location

@joshp23
Copy link
Owner

joshp23 commented Sep 1, 2017

did you try to just copy the files over? perhaps your nginx setup has something against symlinks?

@tofuSCHNITZEL
Copy link
Author

Symlinking was not the issue but the nginx directive suggested by yourls (try_files $uri $uri/ /yourls-loader.php;) I had to use the directive that I also use for wordpress installations:

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

@joshp23
Copy link
Owner

joshp23 commented Sep 3, 2017

Thank you for that. I'll add it to the README, glad you found the problem.

@joshp23 joshp23 closed this as completed Sep 3, 2017
@PrieserMax
Copy link

PrieserMax commented Dec 30, 2023

Hey,
I have a similar issue, running YOURLS behind a Nginx reverse proxy (Nginx Proxy Manager).
Where would I have to change that?
I have entered it in my custom config in the Nginx Proxy. Same behavior as before. Sometimes it works, sometimes it fails :(

Then that appears:
error
When using the short-link followed by .qr it always works.

Greetings from Germany
Max

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

No branches or pull requests

3 participants