Skip to content

Commit e07286c

Browse files
🚧 ssl okay
proxy_set_header X-Forwarded-Proto https
1 parent 8ec3dc2 commit e07286c

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

‎Dockerfile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ COPY nginx.conf /etc/nginx/nginx.conf
33

44
RUN \
55
apk add openssl && \
6-
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx.key -out /etc/ssl/certs/nginx.crt
6+
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/nginx.key -out /etc/nginx/nginx.crt -subj "/C=FR/ST=France/L=Pau/O=Geode-solutions"
7+
78

89
EXPOSE 443

‎nginx.conf‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ http {
1212
server {
1313
listen 443 ssl;
1414
server_name localhost;
15+
1516
ssl_certificate nginx.crt;
1617
ssl_certificate_key nginx.key;
1718

@@ -20,17 +21,25 @@ http {
2021
return 405;
2122
}
2223
rewrite "^/[a-z0-9]{32}/geode/(.*)" /$1 break;
23-
proxy_pass https://localhost:5000;
24+
proxy_pass http://localhost:5000;
2425
proxy_http_version 1.1;
26+
proxy_set_header Host $host;
27+
proxy_set_header X-Real-IP $remote_addr;
28+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
29+
proxy_set_header X-Forwarded-Proto https;
2530
}
2631

2732
location ~ "^/[a-z0-9]{32}/viewer/" {
2833
if ($request_method !~ ^(GET|POST|OPTIONS)$) {
2934
return 405;
3035
}
3136
rewrite "^/[a-z0-9]{32}/viewer/(.*)" /$1 break;
32-
proxy_pass https://localhost:1234;
37+
proxy_pass http://localhost:1234;
3338
proxy_http_version 1.1;
39+
proxy_set_header Host $host;
40+
proxy_set_header X-Real-IP $remote_addr;
41+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
42+
proxy_set_header X-Forwarded-Proto https;
3443
}
3544
}
3645
}

0 commit comments

Comments
 (0)