Switch NGINX to OpenResty, update paths for nginx.conf and auth.lua integration
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
services:
|
services:
|
||||||
reverse-proxy:
|
reverse-proxy:
|
||||||
image: nginx:latest
|
image: openresty/openresty:alpine
|
||||||
container_name: demo-nginx-proxy
|
container_name: demo-nginx-proxy
|
||||||
ports:
|
ports:
|
||||||
- "25700:80"
|
- "25700:80"
|
||||||
volumes:
|
volumes:
|
||||||
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
- ./nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf:ro
|
||||||
- ./auth.lua:/etc/nginx/auth.lua:ro
|
- ./auth.lua:/usr/local/openresty/nginx/conf/auth.lua:ro
|
||||||
environment:
|
environment:
|
||||||
- KEYCLOAK_CLIENT_SECRET=${KEYCLOAK_CLIENT_SECRET}
|
- KEYCLOAK_CLIENT_SECRET=${KEYCLOAK_CLIENT_SECRET}
|
||||||
env_file:
|
env_file:
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ http {
|
|||||||
|
|
||||||
# Protected root route (main site)
|
# Protected root route (main site)
|
||||||
location / {
|
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_pass http://main-website:3000;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
@@ -45,7 +45,7 @@ http {
|
|||||||
|
|
||||||
# Protected demo route
|
# Protected demo route
|
||||||
location /lawfirm/demo1/ {
|
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;
|
rewrite ^/lawfirm/demo1(/.*)$ $1 break;
|
||||||
proxy_pass http://ld1:3000;
|
proxy_pass http://ld1:3000;
|
||||||
|
|||||||
Reference in New Issue
Block a user