node/apache -- reverse proxy subfolder

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

 



(had created a thread for this a few days ago.. but it was
accidentally deleted!)

Hi Frank/list.

This is continuing on my issue of figuring out how to have a test
github/node app run from apache2.

Instead of getting the site content, I seem to get -->"403 forbidden
No matching DirectoryIndex..."


my test ip is http://161.35.5.174/berat.

In order to test that I can access the test url, I created a test app,
that I could access without the reverse proxy. The
test was http://161.35.5.174/berat/aa.html, and displyed the test
msg.. So, getting to the "site/url" should work.

As I've mentioned before, the test app:
 https://github.com/berat/waitlist-landing-page
 It's a node app that I'm running -- http://127.0.0.1:3000
 and using "pm2" and reverse proxy with apache2 to serve the page.

 The test url is -->> http://161.35.5.174/berat (if it were to work,
as it did for a bit)

The docroot
 /var/www/html/berat

config file
 /etc/apache2/berat.conf
 cat berat.conf


<VirtualHost *:80>
    ServerAdmin foo@xxxxxxxxx
    ServerName  temp22
    ServerAlias temp

    DocumentRoot   /var/www/html/berat

 RewriteEngine On

     ProxyPass /berat http://127.0.0.1:3000
     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 +FollowSymLinks   +MultiViews

            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>

for the above berat.conf, I've tested the following as well:

     ProxyPass /berat http://127.0.0.1:3000/
     ProxyPassReverse /berat http://127.0.0.1:3000/

     ProxyPass /berat/ http://127.0.0.1:3000/
     ProxyPassReverse /berat/ http://127.0.0.1:3000/

     ProxyPass /berat http://127.0.0.1:3000/berat
     ProxyPassReverse /berat http://127.0.0.1:3000/berat

     ProxyPass /berat/ http://127.0.0.1:3000/berat/
     ProxyPassReverse /berat/ http://127.0.0.1:3000/berat/

all of these, oin other words, everything I'ver tried gets the same
weird behavior..
the initial url is
 http://161.35.5.174/berat

after testing the url, the url is changed to
 http://161.35.5.174

 and i get the "403 forbidden"

As far as I can tell in the errolog, i see the "No matching
DirectoryIndex...." entry..

I've also tried "<Location" blocks, as well  as "<Proxy" blocks per
some sights I've seen..

I'm missing something that's subtle.. or that I just haven't seen.

ps.. and yes, a while ago, i did manage to somehow get this to work..
but when I was check ing my test scenario, it appears I had multiple
test config files, which may have conflicted.. (didn't think that was
possible though.) So I cleared out everything, and only have this
"berat.conf" as the only enabled file.

any pointers/thoughts/comments.. i'll try.

this is weird..
thanks

ps. i can even allow access to the test srever if need be.

---------------------------------------------------------------------
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