Skip to content

Commit 7f95e0a

Browse files
🚧 test generate ssl
1 parent 818efa3 commit 7f95e0a

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎Dockerfile‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
FROM nginx:alpine
22
COPY nginx.conf /etc/nginx/nginx.conf
33

4-
EXPOSE 80
4+
RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx.key -out /etc/ssl/certs/nginx.crt
5+
6+
EXPOSE 443

‎nginx.conf‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ http {
1010
gzip_min_length 1000;
1111

1212
server {
13-
listen 80;
13+
listen 443 ssl;
1414
server_name localhost;
15+
ssl_certificate nginx.crt;
16+
ssl_certificate_key nginx.key;
1517

1618
location ~ "^/[a-z0-9]{32}/geode/" {
1719
if ($request_method !~ ^(GET|POST|OPTIONS)$) {
1820
return 405;
1921
}
2022
rewrite "^/[a-z0-9]{32}/geode/(.*)" /$1 break;
21-
proxy_pass http://localhost:5000;
23+
proxy_pass https://localhost:5000;
2224
proxy_http_version 1.1;
2325
}
2426

@@ -27,7 +29,7 @@ http {
2729
return 405;
2830
}
2931
rewrite "^/[a-z0-9]{32}/viewer/(.*)" /$1 break;
30-
proxy_pass http://localhost:1234;
32+
proxy_pass https://localhost:1234;
3133
proxy_http_version 1.1;
3234
}
3335
}

0 commit comments

Comments
 (0)