Apache/Proxy: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
(Created page with "<code>nano /etc/apache2/mods-enabled/proxy.conf</code> <source lang="ini" highlight="2,14-36,43" line> <IfModule mod_proxy.c> <VirtualHost *:80> # If you want to use...")
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Modules==
<source lang="bash">
a2enmod proxy
#a2enmod xml2enc
a2enmod proxy_http
#a2enmod proxy_ajp
#a2enmod proxy_balancer
#a2enmod lbmethod_byrequests
</source>
==Config==
<code>nano /etc/apache2/mods-enabled/proxy.conf</code>
<code>nano /etc/apache2/mods-enabled/proxy.conf</code>


<source lang="ini" highlight="2,14-36,43" line>
<source lang="ini" highlight="2,14-37,44" line>
<IfModule mod_proxy.c>
<IfModule mod_proxy.c>
<VirtualHost *:80>
<VirtualHost *:80>
Line 20: Line 31:
         ServerName dev.shahed.biz
         ServerName dev.shahed.biz
         ServerAlias piw.dev.shahed.biz
         ServerAlias piw.dev.shahed.biz
        ServerAdmin [email protected]


         <Proxy *>
         <Proxy *>

Latest revision as of 11:14, 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>