Skip to content

Commit 6a34874

Browse files
authored
Merge pull request dunglas#21 from maxhelias/proxy-nginx
Reverse proxy with nginx
2 parents d8dc263 + 53a2f01 commit 6a34874

File tree

4 files changed

+16
-33
lines changed

4 files changed

+16
-33
lines changed

Dockerfile.h2-proxy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ RUN openssl req -new -passout pass:NotSecure -key server.key -out server.csr \
1010
-subj '/C=SS/ST=SS/L=Gotham City/O=Symfony/CN=localhost'
1111
RUN openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt
1212

13-
FROM httpd:2.4-alpine
13+
FROM nginx:1.15-alpine
1414

15-
COPY --from=0 server.key /usr/local/apache2/conf/server.key
16-
COPY --from=0 server.crt /usr/local/apache2/conf/server.crt
17-
COPY ./docker/httpd/httpd.conf /usr/local/apache2/conf/httpd.conf
15+
RUN mkdir -p /etc/nginx/ssl/
16+
COPY --from=0 server.key server.crt /etc/nginx/ssl/
17+
COPY ./docker/h2-proxy/default.conf /etc/nginx/conf.d/default.conf

docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ services:
3737
context: .
3838
dockerfile: ./Dockerfile.h2-proxy
3939
volumes:
40-
- ./docker/httpd/httpd.conf:/usr/local/apache2/conf/httpd.conf:ro
40+
- ./docker/h2-proxy/default.conf:/etc/nginx/conf.d/default.conf:ro
4141
ports:
4242
- '443:443'

docker/h2-proxy/default.conf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
server {
2+
listen 443 ssl http2;
3+
listen [::]:443 ssl http2;
4+
5+
ssl_certificate /etc/nginx/ssl/server.crt;
6+
ssl_certificate_key /etc/nginx/ssl/server.key;
7+
8+
location / {
9+
proxy_pass http://nginx;
10+
}
11+
}

docker/httpd/httpd.conf

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)