B
B
BiProg2021-04-17 23:39:41
Nginx
BiProg, 2021-04-17 23:39:41

Why doesn't Apache open a site by domain?

I'm trying to make Nginx in the form of a reverse server so that it sends requests to Apache. Apache, on the other hand, to process the names that are accessed, and if such a Wirth. there is a host, I worked with it, and if not, I sent it to Wirth. host stub, i.e. (as an example):
test.domain.ru -> /any/www
projs.domain.ru -> /projs/www

Wirth config. Apache hosts:

<VirtualHost *:6080>
  ServerAdmin [email protected]
  DocumentRoot "/share/apache2/domains/any/www"
  ErrorLog "/var/log/apache2/any-error.log"
  CustomLog "/var/log/apache2/any-access.log" common
  
  <Directory "/share/apache2/domains/any/www">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Require all granted
  </Directory>
</VirtualHost>

<VirtualHost projs.domain.ru:6080>
  ServerAdmin [email protected]
  ServerName projs.domain.ru
  ServerAlias www.projs.domain.ru
  DocumentRoot "/share/apache2/domains/projs/www"
  ErrorLog "/var/log/apache2/projs-error.log"
  CustomLog "/var/log/apache2/projs-access.log" common
  
  <Directory "/share/apache2/domains/projs/www">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Require all granted
  </Directory>
</VirtualHost>

Config with Wirth. nginx hosts:
server {
  listen 80;
  location / {
    proxy_pass http://localhost:6080;
    proxy_store on;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}

Apache 2.4.38, Nginx/1.14.2, Debian

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alegzz, 2021-04-17
@alegzz

Change VirtualHost projs.domain.ru:6080
to
VirtualHost *:6080
what is the point of nginx if the static is still given by Apache?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question