Trouble installing Plone on Ubuntu with Nginx

Plone is inaccessible after install. Currently I am getting a 404, but that's after a few changes to try and get things running.

I followed the instructions here for install:
https://www.howtoforge.com/how-to-install-plone-cms-on-ubuntu-1804/

These instructions worked fine and the universal installer worked great. But I get a 404 whenever I attempt to access the site. If I add the :8080 port to the domain then it times out.

This is my Ngnix .conf file:

server {
  
    listen 80;
    server_name plone.bvkdev.com;
    access_log /var/log/nginx/plone.bvkdev.com.access.log;
    error_log /var/log/nginx/plone.bvkdev.com.error.log;

    # Note that domain name spelling in VirtualHostBase URL matters
    # -> this is what Plone sees as the "real" HTTP request URL.
    # "Plone" in the URL is your site id (case sensitive)
    location / {
          rewrite ^/(.*)$ e/VirtualHostBase/http/plone.bvkdev.com:80/Plone/VirtualHostRoot/$1 break;
          proxy_pass http://127.0.0.1:8080/;
          proxy_set_header        Host            $host;
          proxy_set_header        X-Real-IP       $remote_addr;
          proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

I got the .conf file from Plone's documentation here:
https://docs.plone.org/manage/deploying/front-end/nginx.html#make-nginx-aware-where-the-request-came-from

I have also used the other .conf example on that page where location looked like this:

location / {
      proxy_pass http://plone/VirtualHostBase/http/plone.bvkdev.com:80/Plone/VirtualHostRoot/;
}

The former returns a simple 404 page that might be generated by Plone. But I am unsure. The latter (this shorter location / bit) also returns a Nginx 404.

Additionally, I also tried installing Plone the other day on a fresh server following Plone's documentation and the results were the same. Those instructions are here:
https://docs.plone.org/manage/installing/installation.html

Not really sure where to go here. My subdomain DNS is setup to point at the correct IP as it resolves, but nothing seems to work. Even the error log files don't show anything.

I'd appreciate any kind of feedback, direction or help.

you've got a bunch of things going on that aren't working and this is causing you to chase various rabbits down different holes --so to speak.

start simple first since you seem a little new to this.

Have you installed Nginx via package manager or did you build it yourself?

You're trying to PROXY right? so you need an upstream connection which has your Zope on 8080 defined so that proxy_pass can intercept and map appropriate requests to port 80

# This specifies which IP and port Plone is running on.
# The default is 127.0.0.1:8080
    upstream plone {
    server 127.0.0.1:8090;

...

# Note that domain name spelling in VirtualHostBase URL matters
    # -> this is what Plone sees as the "real" HTTP request URL.
    # "Plone" in the URL is your site id (case sensitive)
    location / {
          proxy_pass http://plone/VirtualHostBase/http/yoursite.com:80/Plone/VirtualHostRoot/;

this is why you're mostly getting no output and no logs. Remember 404 is not found response code, not a non-working code issue. Not found is diff than broken. You've got a misconfiguration, see if you can figure it out. the Plone Docs have the answers you need there.

also make sure your VHM is configured correctly: https://zope.readthedocs.io/en/latest/zopebook/VirtualHosting.html

In order to narrow down the possible problems, I would probably ssh into the server where Plone/Zope is running and fire a request via curl/wget/lynx in order to make sure there is no problem.

I appreciate the assistance from both of you. I managed to find an image by Bitnami for Google Cloud which gets this up and running with the click of a button.

That doesn't exactly teach me to fish, but I'll have to live with that for now.

For what it's worth the part that endlessly confuses me with Plone is the example vhost files don't provide a root directory. I've never seen that. Maybe it's common, but I've never come across such a case and it wasn't clear what directory or file bootstrapped Plone.

Thanks again.

There's no root in a Plone/Nginx configuration because you're not serving up static files (not that you can't do that but you didn't ask) ... Plone is a CMS with its own server (zserver or waitress) and you're basically proxying requests from NGINX to Medusa or Waitress and vice versa. That's why I mentioned that your config seemed to be missing a named upstream provider (plone).

# This specifies which IP and port Plone is running on.
# The default is 127.0.0.1:8080
upstream plone {
 server 127.0.0.1:8080;

}
then we proxy content in/out over 443

server {
 listen 443 default ssl;
 .....
# Note that domain name spelling in VirtualHostBase URL matters
# -> this is what Plone sees as the "real" HTTP request URL.
# "Plone" in the URL is your site ID (case sensitive)
location / {
rewrite ^/(.*)$ /VirtualHostBase/$scheme/yoursite.com:443/Plone/VirtualHostRoot/$1 break;

 # this puts the originating request IP address in the logs
 proxy_pass http://127.0.0.1:8080/;
 proxy_set_header Host $host;
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

 }

Nginx can also help with load balancing too along with caching to save the headache of setting up a varnish or squid instance. Found most of this at this site: Securing Plone Sites With Nginx and HTTPS/SSL

For future reference: we've got documentation on configuring nginx for use with Plone right here: https://docs.plone.org/manage/deploying/front-end/nginx.html

Plone Foundation Code of Conduct