ipam/lb/nginx.dev.conf

54 строки
1.3 KiB
Plaintext

events {}
http {
# include /etc/nginx/conf.d/*.conf;
upstream ui {
server ipam-ui-dev;
server ipam-ui-dev:8080 backup;
}
upstream engine {
server ipam-engine-dev max_fails=5;
server ipam-engine-dev:8080 backup max_fails=5;
}
server {
listen 8080 default_server;
listen [::]:8080 default_server;
proxy_next_upstream error timeout http_502;
# Frontend
location / {
add_header X-Frame-Options "DENY";
proxy_pass http://ui;
proxy_intercept_errors on;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
error_page 404 = /index.html;
}
# WebSockets
location /ws {
proxy_pass http://ui;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
# Backend
location /api {
proxy_pass http://engine;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
}
# You may need this to prevent return 404 recursion.
location = /404.html {
internal;
}
}
}