upstream auth-app {
    server auth-service:8000;
}
 
upstream account-app {
    server account-service:8000;
}
 
upstream data-app {
    server data-service:8000;
}
 

server {
    listen 80;
    server_name localhost;
     

    # Shared proxy settings
    location / {
        
        # Default configuration or index.html
        root /usr/share/nginx/html;
        index index.html;

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
    }

    location /auth {
        proxy_pass http://auth-app/api/auth; 
    } 

    
    location /auth/swagger { 
        proxy_pass http://auth-app/swagger;  
        alias /usr/share/nginx/html/swaggerui/;
    }
    
    location /account {
        proxy_pass http://account-app/api/account/; 
    }     
    
    location /account/swagger {
        proxy_pass http://account-app/swagger; 
    } 

    location /data {
        proxy_pass http://data-app/api/v1/data/; 
    }     
    
    location /data/swagger {
        proxy_pass http://data-app/swagger; 
    } 


}