Apache Proxy - server responded with a status of 404 (Not Found)

Hi Guys,

I want to ask what happen to my plone site after using Apache as frontend proxy. I added a host config file under /etc/apache2/sites-enabled/ and I put the code below based on plone documentation.

UseCanonicalName On

NameVirtualHost *:80
<VirtualHost *:80>
ServerAlias paymaya-plone.com
ServerSignature On

Header set X-Frame-Options "SAMEORIGIN"
Header set Strict-Transport-Security "max-age=15768000; includeSubDomains"
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Type-Options "nosniff"
Header set Content-Security-Policy-Report-Only "default-src 'self'; img-src *; style-src 'unsafe-inline'; script-src 'unsafe-inline' 'unsafe-eval'"

ProxyVia On

# prevent your web server from being used as global HTTP proxy
<LocationMatch "^[^/]">
  Deny from all
</LocationMatch>

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

RewriteEngine on
RewriteRule ^/(.*) http://localhost:8080/VirtualHostBase/http/%{HTTP_HOST}:80/PayMaya/VirtualHostRoot/$1 [P,L]

I also added the code below in /etc/hosts both in my local and vagrant virtual machine
127.0.0.1 paymaya-plone.com

And I change the vagrant file code since Apache uses port 80.
config.vm.network :forwarded_port, guest: 80, host: 8080

Then when I browse 0.0.0.0:8080 I can successfully see the Apache default html page

**Now when I browse paymaya-plone:8080 to my local it cannot locate the page, js and css.

It looks to me it is a problem in your VHM conf. Adjust the rewrite rule until the linked resources have the proper URL.

Can you paste some link that are generated by your current configuration?

Hi @alert

I can't paste any link since it just running on my local computer. When I try to browse directly in Zope, all the assets are being load properly:

But when I try to browse via Apache it generates an error:

I meant your local links that you read in the served html... something like http://paymaya-plone:8080/...
From the image you are posting I see you have many 404.
Which URL is the browser trying to fetch?

Please paste the TEXT of your browser console errors - it's very hard to see what's on the screen shots.

But based on the last screen shot it seems to me your problem is in the content security policy directives, that are either missing entirely or are too restrictive and are thus preventing your browser from loading things.