https://github.com/ryoluo/sail-ssl
Laravel Sail plugin to enable SSL (HTTPS) connection with Nginx.
https://github.com/ryoluo/sail-ssl
https laravel laravel-sail nginx php ssl
Last synced: 3 months ago
JSON representation
Laravel Sail plugin to enable SSL (HTTPS) connection with Nginx.
- Host: GitHub
- URL: https://github.com/ryoluo/sail-ssl
- Owner: ryoluo
- License: mit
- Created: 2022-06-03T16:24:03.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-27T13:55:37.000Z (10 months ago)
- Last Synced: 2025-08-30T21:29:26.025Z (4 months ago)
- Topics: https, laravel, laravel-sail, nginx, php, ssl
- Language: PHP
- Homepage:
- Size: 52.7 KB
- Stars: 186
- Watchers: 2
- Forks: 18
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🚢 Sail-SSL




Laravel Sail plugin to enable SSL (HTTPS) connection with Nginx.
## Install
You need to setup [Laravel Sail](https://github.com/laravel/sail) environment before using the plugin.
### With local PHP / Composer:
```sh
composer require ryoluo/sail-ssl --dev
php artisan sail-ssl:install
./vendor/bin/sail up
```
### With Sail container:
```sh
./vendor/bin/sail up -d
./vendor/bin/sail composer require ryoluo/sail-ssl --dev
./vendor/bin/sail artisan sail-ssl:install
./vendor/bin/sail down
./vendor/bin/sail up
```
After containers started, you can access https://localhost.
## Environment variables
- `SERVER_NAME`
- Determine `server_name` directive in nginx.conf
- Default: `localhost`
- `APP_SERVICE`
- Specify Laravel container name in docker-compose.yml
- Default: `laravel.test`
- `HTTP_PORT`
- Port to forward Nginx HTTP port
- By default, request for this port would redirect to `SSL_PORT`
- Default: `8000`
- `SSL_PORT`
- Port to forward Nginx HTTPS port
- Default: `443`
- `SSL_DOMAIN`
- The Common Name to use in the SSL certificate, e.g. `SSL_DOMAIN=*.mydomain.test`
- Required to generate a valid certificate for a domain other than `localhost`
- Default: `localhost`
- `SSL_ALT_NAME`
- The Subject Alternative Name to use in the SSL certificate, e.g. `SSL_ALT_NAME=DNS:localhost,DNS:mydomain.test`
- Required to generate a valid certificate for a domain other than `localhost`
- Default: `DNS:localhost`
## Configure Nginx
`./nginx/templates/default.conf.template` will be published.
```sh
php artisan sail-ssl:publish
```
## Contribution
Feel free to create a PR!