Apache version of ngx_stream_ssl_preread_module

Viewed 154

I am trying to run TURN protocol over Apache proxy. In Nginx proxies, there is a module for prereading the stream mode, and proxy it to where we want. For example:

stream {
    upstream web {
        server 127.0.0.1:4444;
    }
    upstream turn {
        server 10.0.0.100:5349;
    }

    map $ssl_preread_server_name $upstream {
        turn.example.com        turn;
        default                 web;
    }

    server {
        listen 443;
        listen [::]:443;
        ssl_preread on;
        proxy_pass $upstream;
        # Increase buffer to serve video
        proxy_buffer_size 10m;
    }
}

Here, we can proxy the turn traffic to the TURN port, by prereading the server name.
I couldn't find anything like this in Apache.

Is there a way for this in Apache proxy?

1 Answers

For Apache:

sudo apt-get update
sudo apt-get install apache2
sudo a2enmod proxy
sudo a2enmod proxy_http

    <VirtualHost *:8880>
        ServerName example.com
        ServerAlias #SERVER_OWN_IP#
        ServerAdmin #SERVER_OWN_IP#
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        ProxyRequests Off
        <Proxy *>
          Order deny,allow
          Allow from all
        </Proxy>
        
        ProxyPass / http://127.0.0.1:8080/
        ProxyPassReverse / http://127.0.0.1:8080/

        <Location />
          Order allow,deny
          Allow from all
        </Location>

    </VirtualHost>

sudo systemctl restart apache2.service
Related