https://github.com/qzchenwl/multi-ssl-nginx-conf
https://github.com/qzchenwl/multi-ssl-nginx-conf
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/qzchenwl/multi-ssl-nginx-conf
- Owner: qzchenwl
- Created: 2016-10-10T08:16:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-11T03:56:55.000Z (over 8 years ago)
- Last Synced: 2025-01-18T21:31:27.456Z (5 months ago)
- Language: Shell
- Size: 20.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Multiple SSL Certificates on a Single IP Using Nginx
# Usage
## Start server
```
you@host$ git clone https://github.com/qzchenwl/multi-ssl-nginx-conf
you@host$ cd multi-ssl-nginx-confyou@host$ docker run --name nginx-ssl -nginx --rm -it -p 80:80 -p 443:443 \
-v $PWD/nginx.conf:/etc/nginx/nginx.conf \
-v $PWD/ssl:/etc/nginx/ssl \
-v $PWD/sites-available:/etc/nginx/sites-available \
-v $PWD/sites-enabled:/etc/nginx/sites-enabled \
nginxroot@docker# service nginx restart
```## Generate certificate
```
you@host$ cd ssl
you@host$ ./generate.sh
```## Generate virtual host file
```
you@host$ cd sites-available
you@host$ ./generate.sh
```## Example virtual host file
```conf
server {
listen 443;
server_name example.com;
root /usr/share/nginx/www;
index index.html index.htm;
ssl on;
ssl_certificate /etc/nginx/ssl/example.com/server.crt;
ssl_certificate_key /etc/nginx/ssl/example.com/server.key;
}
```# Reference
[Multiple SSL Certificates on a Single IP Using Nginx](http://www.supportpro.com/blog/multiple-ssl-certificates-on-a-single-ip-using-nginx/)