Reverse proxy

In order to use the STANAG On Demand Server in the production environment you should consider putting it behind a reverse proxy server.
Reverse proxy service sits in front of the StServer service, accepting requests from clients for resources located on the server. From the client's point of view, the reverse proxy appears to be the actual STANAG On Demand Server server. Though it is possible to operate all the internal microservices without it (for example, for testing or inside a bigger system) it is highly recommended that you use it.

NGINX reverse proxy

Though for every particular setup there will be a different reverse proxy configuration, here is a simplified example that does the following:
- Forwards frontend and api requests to the server running on port 8080.
- Intercepts and forwards requests for video content to the video http server running on port 8084.

server {

        listen 80;
        listen [::]:80;

        client_max_body_size 0;                 # to enable large video files upload

        server_name stserver.mydomain.com;

        location /  {

                    proxy_pass         http://localhost:8080;
                    proxy_set_header   X-Forwarded-For $remote_addr;
                    proxy_set_header   Host $http_host; 
                    proxy_http_version 1.1;
                    proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection "upgrade";              
        }


        location /videos/  {

                    proxy_pass         http://localhost:8084;   
                    proxy_set_header   X-Forwarded-For $remote_addr;
                    proxy_set_header   Host $http_host;                 
        }
}