Using the api commands in Yourls/Docker

I have yourls running under docker successfully using this configuration:

yourls:
image: yourls:1.7.4
ports:
  - 80:80
environment:
  YOURLS_SITE: http://localhost:80
  YOURLS_USER: example_username
  YOURLS_PASS: example_password  
depends_on: 
  - mysql

And I’m able to add links through the dashboard, however, when I attempt to lookup a short URL through the API, I get this error:

yourls_1 | 172.22.0.6 - - [03/Oct/2020:07:27:30 +0000] “GET /?url=http%3A%2F%2Flocalhost%3A5000%2Forg%2Fasdf&action=shorturl&keyword=asdf&signature=a0bd396d5d&format=json HTTP/1.1” 403 451 “-” “-”

yourls_1 | [Sat Oct 03 07:27:30.116279 2020] [autoindex:error] [pid 25] [client 172.22.0.6:38700] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive

Any guidance would be great!

I think it should GET /yourls-api.php?blabla, not /?blabla

1 Like

:face_with_hand_over_mouth: you’re right. thanks so much.