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

Certificate location error when installing the project on some other computer #11

Closed
phlisg opened this issue Jun 9, 2023 · 3 comments

Comments

@phlisg
Copy link

phlisg commented Jun 9, 2023

Hello,

I've installed a project on a new computer and upon launching docker, I noticed that nginx imediately quits.

I see this message in the logs:

2023-06-09 10:45:55 nginx: [emerg] cannot load certificate "/etc/nginx/certs/server.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/nginx/certs/server.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)

I tried rebuilding from docker-compose, deleted the image and the container, but still nothing. I also tried sail artisan sail-ssl:install but reports everything is set correctly.

My docker-compose.yml seems ok too:

    nginx:
        image: 'nginx:latest'
        ports:
            - '${HTTP_PORT:-8000}:80'
            - '${SSL_PORT:-443}:443'
        environment:
            - SSL_PORT=${SSL_PORT:-443}
            - APP_SERVICE=${APP_SERVICE:-laravel.test}
            - SERVER_NAME=${SERVER_NAME:-localhost}
        volumes:
            - 'sail-nginx:/etc/nginx/certs'
            - './docker/nginx/templates:/etc/nginx/templates'
            - './vendor/ryoluo/sail-ssl/nginx/generate-ssl-cert.sh:/docker-entrypoint.d/99-generate-ssl-cert.sh'

What should I do?
Thank you for your help.

@ryoluo
Copy link
Owner

ryoluo commented Jun 26, 2023

The script to generate sever certificates might be failed to execute.
You should change owner of vendor directory to enable to execute the script.
sudo chown -R $USER:$USER ./vendor

@ryoluo
Copy link
Owner

ryoluo commented Jun 26, 2023

@phlisg
As resolved in #13, the problem is permision of the script.
Please try chmod +x vendor/ryoluo/sail-ssl/nginx/generate-ssl-cert.sh

@phlisg
Copy link
Author

phlisg commented Jul 7, 2023

Thank you, it solved the issue (didn't think it was a permission error but thank you for the heads up :))!

@phlisg phlisg closed this as completed Jul 7, 2023
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

2 participants