Apache/Proxy: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
Line 2: Line 2:
<source lang="bash">
<source lang="bash">
a2enmod proxy
a2enmod proxy
a2enmod xml2enc
a2enmod proxy_http
a2enmod proxy_http
#a2enmod proxy_ajp
#a2enmod proxy_ajp

Revision as of 10:56, 1 September 2019

Modules

a2enmod proxy
a2enmod xml2enc
a2enmod proxy_http
#a2enmod proxy_ajp
#a2enmod proxy_balancer
#a2enmod lbmethod_byrequests

Config

nano /etc/apache2/mods-enabled/proxy.conf

<IfModule mod_proxy.c>
<VirtualHost *:80>

        # If you want to use apache2 as a forward proxy, uncomment the
        # 'ProxyRequests On' line and the <Proxy *> block below.
        # WARNING: Be careful to restrict access inside the <Proxy *> block.
        # Open proxy servers are dangerous both to your network and to the
        # Internet at large.
        #
        # If you only want to use apache2 as a reverse proxy/gateway in
        # front of some web application server, you DON'T need
        # 'ProxyRequests On'.

        ProxyRequests Off
        ProxyPreserveHost On
        AllowEncodedSlashes Off
        ServerName dev.shahed.biz
        ServerAlias piw.dev.shahed.biz
        ServerAdmin [email protected]

        <Proxy *>
            Order Allow,Deny
            Allow from all
            Deny from 10.20.13.10
        </Proxy>

        # proxy for ebis
        ProxyPass /ebis http://mac.dev.shahed.biz:8302/ebis nocanon
        ProxyPassReverse /ebis http://mac.dev.shahed.biz:8302/ebis

        # proxy for fhir
        ProxyPass /fhir http://mac.dev.shahed.biz:8303/fhir nocanon
        ProxyPassReverse /fhir http://mac.dev.shahed.biz:8303/fhir

        # proxy for init
        ProxyPass /init http://mac.dev.shahed.biz:8304/init nocanon
        ProxyPassReverse /init http://mac.dev.shahed.biz:8304/init

        # Enable/disable the handling of HTTP/1.1 "Via:" headers.
        # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
        # Set to one of: Off | On | Full | Block
        #ProxyVia Off

</VirtualHost>
</IfModule>