waterwolf-auth/configs/nginx-dev.conf
2024-11-12 15:19:23 -05:00

59 lines
No EOL
1.7 KiB
Text

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
gzip on;
server {
listen 80;
#Custom Nest.js API
location /api/ {
resolver 127.0.0.11 valid=30s; # Docker DNS
proxy_pass http://host.docker.internal:3001/api/; # Local back end
proxy_redirect default;
proxy_set_header Host $host;
}
#OIDC Provider
location /oidc/ {
resolver 127.0.0.11 valid=30s; # Docker DNS
proxy_pass http://host.docker.internal:3001/oidc/; # Local back end
proxy_redirect default;
#Needed for Host File
proxy_set_header Host $host;
}
#Frontend Next.js App
location / {
resolver 127.0.0.11 valid=30s; # Docker DNS
proxy_pass http://host.docker.internal:3000/; # Local back end
proxy_redirect default;
# Change the host header to the original host
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
}
}