46 lines
999 B
Nginx Configuration File
46 lines
999 B
Nginx Configuration File
|
error_log /dev/stdout info;
|
||
|
|
||
|
events {}
|
||
|
|
||
|
http {
|
||
|
# https://github.com/jetbrains-infra/docker-nginx-resolver
|
||
|
include /etc/nginx/includes/resolver.conf;
|
||
|
|
||
|
# https://www.nginx.com/blog/websocket-nginx/
|
||
|
map $http_upgrade $connection_upgrade {
|
||
|
default upgrade;
|
||
|
'' close;
|
||
|
}
|
||
|
|
||
|
upstream rest-api {
|
||
|
server mango-service-v3:3000;
|
||
|
}
|
||
|
|
||
|
upstream ws-api {
|
||
|
server mango-vial:8000;
|
||
|
}
|
||
|
|
||
|
server {
|
||
|
access_log /dev/stdout;
|
||
|
|
||
|
listen 80;
|
||
|
|
||
|
# https://localhost/api
|
||
|
location /api/ {
|
||
|
set $backend_api "http://rest-api/api/";
|
||
|
if ($request_uri ~* "/api/(.*$)") {
|
||
|
set $path_remainder $1;
|
||
|
}
|
||
|
proxy_pass $backend_api$path_remainder;
|
||
|
}
|
||
|
|
||
|
# ws://localhost/ws
|
||
|
location /ws {
|
||
|
proxy_pass http://ws-api/v1/ws;
|
||
|
proxy_http_version 1.1;
|
||
|
proxy_set_header Upgrade $http_upgrade;
|
||
|
proxy_set_header Connection $connection_upgrade;
|
||
|
proxy_set_header Host $host;
|
||
|
}
|
||
|
}
|
||
|
}
|