waterwolf-auth/configs/nginx-dev.conf

59 lines
1.7 KiB
Text
Raw Normal View History

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;
2024-11-12 20:19:23 +00:00
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;
2024-11-12 20:19:23 +00:00
#Needed for Host File
proxy_set_header Host $host;
}
#Frontend Next.js App
location / {
resolver 127.0.0.11 valid=30s; # Docker DNS
2024-10-16 21:42:59 +00:00
proxy_pass http://host.docker.internal:3000/; # Local back end
proxy_redirect default;
2024-11-12 20:19:23 +00:00
# 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;
}
}
}