Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Docker Nginx Auto Ssl
Commits
24cd0fff
Unverified
Commit
24cd0fff
authored
Nov 24, 2017
by
Jakub Skałecki
Committed by
GitHub
Nov 24, 2017
Browse files
Create README.md
parent
b9b835ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
README.md
0 → 100644
View file @
24cd0fff
# docker-nginx-auto-ssl
Docker image for automatic generation of SSL certs using Let's encrypt and Open Resty, with reasonable SSL settings.
You can specify allowed domains using ENV variable, and easily override
`nginx.conf`
to your needs.
This is possible thanks to
[
OpenResty
](
https://github.com/openresty/openresty
)
and
[
lua-resty-auto-ssl
](
https://github.com/GUI/lua-resty-auto-ssl
)
.
# Usage
Simply run:
```
Bash
docker run -d \
-p 80:80 \
-p 443:443 \
valian/docker-nginx-auto-ssl
```
Created certs are kept in
`/etc/resty-auto-ssl`
directory. It's volume by default, but you may want to mount it to some directory on the host.
All options:
**ALLOWED_DOMAINS**
-
[
lua pattern
](
http://lua-users.org/wiki/PatternsTutorial
)
of allowed domains. We're using
`string.match`
**DIFFIE_HELLMAN**
- force regeneration of
`dhparam.pem`
. If not specified, default one is used.
Advanced usage:
```
Bash
docker run -d \
--name nginx-auto-ssl \
--restart on-failure \
-p 80:80 \
-p 443:443 \
-e ALLOWED_DOMAINS=.*example.com \
-e DIFFIE_HELLMAN=true \
-v ssl-data:/etc/resty-auto-ssl \
valian/docker-nginx-auto-ssl
```
# Custom `nginx.conf`
Currently, image just generates SSL certs on-the-fly. You have to provide your own configuration to be able to use image.
Example
`Dockerfile`
:
```
Dockerfile
FROM
valian/docker-nginx-auto-ssl
COPY
nginx.conf /usr/local/openresty/nginx/conf/
```
Minimal working
`nginx.conf`
:
```
nginx
events
{
worker_connections
1024
;
}
http
{
include
resty-http.conf
;
server
{
listen
443
ssl
;
include
ssl.conf
;
include
resty-server-https.conf
;
# you should add provide your own locations here
}
server
{
listen
80
default_server
;
include
resty-server-http.conf
;
}
}
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment