Skip to content

Commit f275f41

Browse files
(ADDED) ssl support added
1 parent 7b7dcca commit f275f41

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ FROM nginx:alpine
33

44
COPY nginx.conf /etc/nginx/nginx.conf
55

6+
# for ssl
7+
# COPY elisa.crt /etc/nginx/ssl/elisa.crt
8+
# COPY private.key /etc/nginx/ssl/private.key
9+
610
EXPOSE 80
11+
EXPOSE 443
712

813
WORKDIR /usr/share/nginx/html
914

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ services:
44
app:
55
image: 'angular-docker'
66
ports:
7-
- 3000:80
7+
- 80:80
8+
- 443:443

nginx.conf

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ events {
77
http {
88
server {
99
listen 80;
10-
server_name localhost;
10+
server_name elisatheai.me www.elisatheai.me;
11+
12+
# return 301 https://www.elisatheai.me/;
1113

1214
root /usr/share/nginx/html;
1315
index index.html index.htm;
@@ -22,4 +24,25 @@ http {
2224
try_files $uri $uri/ /index.html;
2325
}
2426
}
27+
28+
server {
29+
listen 443 ssl;
30+
server_name elisatheai.me www.elisatheai.me;
31+
32+
ssl_certificate /etc/nginx/ssl/elisa.crt;
33+
ssl_certiifcate_key /etc/nginx/ssl/private.key;
34+
35+
root /usr/share/nginx/html;
36+
index index.html index.htm;
37+
include /etc/nginx/mime.types;
38+
39+
gzip on;
40+
gzip_min_length 1000;
41+
gzip_proxied expired no-cache no-store private auth;
42+
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
43+
44+
location / {
45+
try_files $uri $uri/ /index.html;
46+
}
47+
}
2548
}

0 commit comments

Comments
 (0)