Skip to content

Commit

Permalink
Merge pull request #4 from reload/proxy
Browse files Browse the repository at this point in the history
Add plain proxy and NextJS proxy
  • Loading branch information
arnested authored Jun 26, 2024
2 parents c8d0020 + fb16146 commit 403ac56
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,17 @@ COPY /drupal /

ENV NGINX_FASTCGI_PASS_HOST php
ENV NGINX_FASTCGI_PASS_PORT 9000

##
# Proxy
##
FROM base AS proxy

COPY /proxy /

##
# NextJS
##
FROM base AS nextjs

COPY /nextjs /
21 changes: 21 additions & 0 deletions context/nextjs/etc/nginx/templates/default.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Based on https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/
# and https://github.com/rpayanm/drupal/blob/master/nginx/default
# and https://blog.john-pfeiffer.com/drupal-with-docker-compose-and-nginx-and-php-fpm-and-mariadb/
server {

include include.d/ssl.conf;

root /var/www/web;

location / {
proxy_pass http://${NGINX_PROXY_PASS};
}

location /_next/webpack-hmr {
proxy_pass http://${NGINX_PROXY_PASS};
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
}
13 changes: 13 additions & 0 deletions context/proxy/etc/nginx/templates/default.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Based on https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/
# and https://github.com/rpayanm/drupal/blob/master/nginx/default
# and https://blog.john-pfeiffer.com/drupal-with-docker-compose-and-nginx-and-php-fpm-and-mariadb/
server {

include include.d/ssl.conf;

root /var/www/web;

location / {
proxy_pass ${NGINX_PROXY_PASS};
}
}

0 comments on commit 403ac56

Please sign in to comment.