Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .ebextensions/ssl.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
files:
"/etc/nginx/certs/server.crt":
mode: "000644"
owner: root
group: root
content: |
-----BEGIN CERTIFICATE-----
${SERVER_CRT}
-----END CERTIFICATE-----

"/etc/nginx/certs/server.key":
mode: "000600"
owner: root
group: root
content: |
-----BEGIN PRIVATE KEY-----
${SERVER_KEY}
-----END PRIVATE KEY-----
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ services:

nginx:
build: ./nginx
volumes:
- ./certs:/etc/nginx/certs:ro
ports:
- 8080:80
- 80:80
- 443:443
restart: always
depends_on:
- prosthetics_web_app
Expand Down
13 changes: 13 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,22 @@ events {
}

http {
# Redirect all HTTP to HTTPS
server {
listen 80;
server_name www.hearing.3dp4me-software.org hearing.3dp4me-software.org
www.prosthetics.3dp4me-software.org prosthetics.3dp4me-software.org
www.pt.3dp4me-software.org pt.3dp4me-software.org;
return 301 https://$host$request_uri;
}

server {
listen 443 ssl http2;
server_name www.hearing.3dp4me-software.org hearing.3dp4me-software.org;

ssl_certificate /etc/nginx/certs/server.crt;
ssl_certificate_key /etc/nginx/certs/server.key;

location / {
client_max_body_size 100G;
proxy_pass http://hearing_aid_web_app:5050/;
Expand Down
Loading