0

I have an NGINX reverse proxy with Apache running on Linux22. My goal is to serve a file in a new documentroot, but for whatever, the Nginx Default conf serves the old apache2 index file. The documentRoot is correctly specified and the path is correctly spelled, too.

ls /etc/nginx/sites-enabled/default

server {
        listen 80 default_server;
        listen [::]:80 default_server;
        # SSL configuration
        #
        # listen 443 ssl default_server;
        # listen [::]:443 ssl default_server;
    
        # root /var/www/html;
        root /var/www/clients/client0/web1/web;

        # Add index.php to the list if you are using PHP
        index index.html index.htm index.nginx-debian.html;

        server_name _;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                #try_files $uri $uri/ =404;
                proxy_pass http://IP:8090/;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
        }

100-DOMAIN.vhost


<Directory /var/www/DOMAIN>
                AllowOverride None
                                Require all denied
                </Directory>

<VirtualHost *:80>


                                        DocumentRoot /var/www/clients/client0/web1/web

                ServerName DOMAIN
                ServerAdmin webmaster@DOMAIN


                ErrorLog /var/log/ispconfig/httpd/DOMAIN/error.log

                Alias /error/ "/var/www/DOMAIN/web/error/"

Worthy to mention, that I strongly assume that since it goes after the default server, it checks the vhost configurations per order. I have two more vhosts starting both with 000... Is this the issue? If yes, what can I do to fix it? Thanks!

2
  • 3
    You proxy to port 8090 with proxy_pass http://IP:8090/; and you quote an Apache config for port 80 <VirtualHost *:80> so I am more confused than you now
    – HBruijn
    Commented Feb 25 at 20:50
  • That's it. I would like to mark your answer as the correct one, but since it has been a comment, I cannot even upvote it. Commented Feb 26 at 11:28

0

You must log in to answer this question.

Browse other questions tagged .