From e8b7db4edb47f9eb3e2a791add991a0a7d69a39f Mon Sep 17 00:00:00 2001 From: Thatsaphorn Atchariyaphap Date: Mon, 9 Jun 2025 10:27:53 +0200 Subject: [PATCH] Switch NGINX to OpenResty, update paths for `nginx.conf` and `auth.lua` integration --- docker-compose.yml | 6 +++--- nginx.conf | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 457c23b..393d9e8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,12 @@ services: reverse-proxy: - image: nginx:latest + image: openresty/openresty:alpine container_name: demo-nginx-proxy ports: - "25700:80" volumes: - - ./nginx.conf:/etc/nginx/nginx.conf:ro - - ./auth.lua:/etc/nginx/auth.lua:ro + - ./nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf:ro + - ./auth.lua:/usr/local/openresty/nginx/conf/auth.lua:ro environment: - KEYCLOAK_CLIENT_SECRET=${KEYCLOAK_CLIENT_SECRET} env_file: diff --git a/nginx.conf b/nginx.conf index a545ddb..51114e3 100644 --- a/nginx.conf +++ b/nginx.conf @@ -34,7 +34,7 @@ http { # Protected root route (main site) location / { - access_by_lua_file /etc/nginx/auth.lua; + access_by_lua_file /usr/local/openresty/nginx/conf/auth.lua; proxy_pass http://main-website:3000; proxy_set_header Host $host; @@ -45,7 +45,7 @@ http { # Protected demo route location /lawfirm/demo1/ { - access_by_lua_file /etc/nginx/auth.lua; + access_by_lua_file /usr/local/openresty/nginx/conf/auth.lua; rewrite ^/lawfirm/demo1(/.*)$ $1 break; proxy_pass http://ld1:3000;