-
Notifications
You must be signed in to change notification settings - Fork 1
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 when accessing http://127.0.0.1:8080/openapi #3
Comments
fixed here 3fe5ae4 just missed to put api.php in the right position (it worked on my machine for the exact reason I asked you to try it 😅 ) would u give it a try again? |
there's still something missing. this web:
image: nginx:latest
container_name: nginx_treeqlqs
restart: always
environment:
SERVER_NAME: ${SERVER_NAME}
PHP_CRUD_API_PORT: ${PORT}
PHP_CRUD_API_ADDRESS: ${SERVER_NAME}
PHP_CRUD_API_DATABASE: ${MYSQL_DATABASE}
PHP_CRUD_API_USERNAME: ${MYSQL_USER}
PHP_CRUD_API_PASSWORD: ${MYSQL_PASSWORD}
PHP_CRUD_API_DEBUG: ${PHP_CRUD_API_DEBUG}
volumes:
- ./nginx/default.conf.template:/etc/nginx/conf.d/default.conf.template
- ./php:/var/www/html
ports:
- "${PORT}:80"
command: /bin/bash -c "curl -o /var/www/html/api.php https://raw.githubusercontent.com/mevdschee/php-crud-api/main/api.php && envsubst '$$SERVER_NAME' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
depends_on:
- php
networks:
- php-api-network is the code setting up the nginx container. all the env variables are properly set and available in the nginx container shell (I've checked their values one by one) but I'm getting
I found the exception in As long as I was using a static version (copy-pasted) of UPDATES Enabling the debug flag, the previous PDO exception error turns into |
Probably you have no access to |
It's something related to the env variables. If I properly set the configuration fields it works. If I leave the config section as is counting on the docker compose env variables it doesn't. |
Do u have any hint/idea on why the api.php is unable to catch the env variables in the nginx image even if the are there as shown by the screenshot above? |
I think the PHP_CRUD_API_ADDRESS should be the hostname of the database, not the URL. |
I realised that and I fixed it, but the problem persists. |
Can you post another dump of the env variables? |
Hi, I had the same issue and solved it by some changements in the docker-compose file. The debug var and some other things were not on the right place. |
Yes, you are correct, current container_name is "mysql_treeqlqs" so:
This error is not impactful:
|
fixed in 1.0.3 |
Can you see why I get a 404 on
http://127.0.0.1:8080/openapi
? I think it is about these lines:Can you confirm? What is causing that?
The text was updated successfully, but these errors were encountered: