Merge pull request from maxhelias/proxy-nginx

Reverse proxy with nginx
This commit is contained in:
Kévin Dunglas 2018-06-26 09:14:16 +02:00 committed by GitHub
commit 6a348748e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 33 deletions

@ -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

@ -37,6 +37,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
ports:
- '443:443'

@ -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;
}
}

@ -1,28 +0,0 @@
ServerName localhost
Listen 443
SSLEngine on
SSLCertificateFile "/usr/local/apache2/conf/server.crt"
SSLCertificateKeyFile "/usr/local/apache2/conf/server.key"
SSLSessionCache "shmcb:/usr/local/apache2/logs/ssl_scache(512000)"
User daemon
Group daemon
ErrorLog /proc/self/fd/2
CustomLog /proc/self/fd/1 "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
Protocols h2 http/1.1
ProxyPass / http://nginx/
ProxyPassReverse / http://nginx/
LoadModule mpm_event_module modules/mod_mpm_event.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule http2_module modules/mod_http2.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule unixd_module modules/mod_unixd.so