Skip to content

Reverse proxy with nginx #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2018
Merged
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
8 changes: 4 additions & 4 deletions Dockerfile.h2-proxy
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ RUN openssl req -new -passout pass:NotSecure -key server.key -out server.csr \
-subj '/C=SS/ST=SS/L=Gotham City/O=Symfony/CN=localhost'
RUN openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt

FROM httpd:2.4-alpine
FROM nginx:1.15-alpine

COPY --from=0 server.key /usr/local/apache2/conf/server.key
COPY --from=0 server.crt /usr/local/apache2/conf/server.crt
COPY ./docker/httpd/httpd.conf /usr/local/apache2/conf/httpd.conf
RUN mkdir -p /etc/nginx/ssl/
COPY --from=0 server.key server.crt /etc/nginx/ssl/
COPY ./docker/h2-proxy/default.conf /etc/nginx/conf.d/default.conf
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ services:
context: .
dockerfile: ./Dockerfile.h2-proxy
volumes:
- ./docker/httpd/httpd.conf:/usr/local/apache2/conf/httpd.conf:ro
- ./docker/h2-proxy/default.conf:/etc/nginx/conf.d/default.conf:ro
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the file seems to be copied during the image building, is it really needed?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Copying is for prod, the volume is for dev (you change the file, reboot the service and it's taken into account without having to rebuild the image)

Copy link
Contributor

@ajardin ajardin Jun 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's my first guess, forget that. 😄

ports:
- '443:443'
11 changes: 11 additions & 0 deletions docker/h2-proxy/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;

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

location / {
proxy_pass http://nginx;
}
}
28 changes: 0 additions & 28 deletions docker/httpd/httpd.conf

This file was deleted.