reverse proxy test ,multiple test sites

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Update on testing apache - reverse proxy/nextjs apps. The idea is to
run a local node server (http://127.0.0.1:x) whis is displayed via
Apache.

I have two/2 examples that appear to work if run separately. running
is configured (a2enmod/a2ensite) as well as "systemctl restart
apache2".

I can view each test site.

However, when trying to run both at the same time, ie both
configured/enabled and Apache restarted, only one (the 1st) -- not
sure how that's determined, is vaild in the browser. The 2nd displays
the dir/file index.

When on the server, doinhg a
 curl http://127.0.0.1:3000
 curl http://127.0.0.1:3004
The data for both test apps is generated.

Looking through the error.log doesn't seem to show any errs.

Any thoughts/comments?

Thanks

testapp1  (this app displays the dir index)
cat soufianeelc.conf

<VirtualHost *:80>
    ServerAdmin foo@xxxxxxxxx
    ServerName  temp223sa
    ServerAlias temp3sa

 #test frm web
 ProxyRequests Off
 ProxyPreserveHost On
 ProxyVia Full

    DocumentRoot   /var/www/html/soufianeelc

 RewriteEngine On

       #try using the attached dir
       RewriteRule ^/?$ /soufianeelc/ [R=permanent,L]

       <Location "/soufianeelc">
         ProxyPass http://127.0.0.1:3004
       </Location>

       ProxyPassReverse /soufianeelc http://127.0.0.1:3004

#ttest substitute below
 RewriteEngine On
#test aug25    SetOutputFilter INFLATE;proxy-html;SUBSTITUTE;DEFLATE;
    ProxyHTMLInterp On
    ProxyHTMLExtended Off


#      AddOutputFilterByType SUBSTITUTE text/html
#      Substitute "s|/_next/static/|\.\./\.next/static/|"
#      Substitute
"s|/_next/image\?url=\%2Fhero.jpg\&amp;w=1920\&amp;q=75|\.\./public/hero1|i"


    <Directory    /var/www/html/soufianeelc>

  Header Set Pragma "no-cache"
  Header Set Expires "Thu, 1 Jan 1970 00:00:00 GMT"
  Header Set Cache-Control "max-age=0, no-store, no-cache, must-revalidate"
  Header Unset ETag
  FileETag None

            Options -Indexes

            AllowOverride All

            #use for 2.4?
            Require all granted

            ##Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All Require all granted
    </Directory>

    ###Alias "/sendportal/" "/var/www/html/sendportal/public/"

    LogLevel debug
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>





testapp2 (app displays content in browser)
<VirtualHost *:80>
    ServerAdmin foo@xxxxxxxxx
    ServerName  temp22qq
    ServerAlias tempqq

    ProxyRequests Off
    ProxyPreserveHost On
    ProxyVia Full

    DocumentRoot   /var/www/html/berat

 RewriteEngine On

       RewriteRule ^/?$ /berat/ [R=permanent,L]

       <Location "/berat">
         ProxyPass http://127.0.0.1:3000
       </Location>

       ProxyPassReverse /berat http://127.0.0.1:3000


 RewriteEngine On
    SetOutputFilter INFLATE;proxy-html;SUBSTITUTE;DEFLATE;
    ProxyHTMLInterp On
    ProxyHTMLExtended Off


      AddOutputFilterByType SUBSTITUTE text/html
      Substitute "s|/_next/static/|\.\./\.next/static/|"
      Substitute
"s|/_next/image\?url=\%2Fhero.jpg\&amp;w=1920\&amp;q=75|\.\./public/hero1|i"


    <Directory    /var/www/html/berat>

  Header Set Pragma "no-cache"
  Header Set Expires "Thu, 1 Jan 1970 00:00:00 GMT"
  Header Set Cache-Control "max-age=0, no-store, no-cache, must-revalidate"
  Header Unset ETag
  FileETag None

            Options -Indexes

            AllowOverride All

            #use for 2.4?
            Require all granted

    </Directory>


    LogLevel debug
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux