Здравствуйте.
В докере поднято приложение, на входе которого стоит nginx со следующим конфигом:
server {
listen 80;
server_name my.localhost;
location ^/cdn/ {
proxy_pass http://app:8082/;
}
location ^/api/ {
proxy_pass http://app:8081/;
}
location / {
proxy_pass http://app:8080;
}
}
server {
listen 80;
server_name cdn.localhost;
location / {
proxy_pass http://app:8082;
}
}
server {
listen 80;
server_name internal-api.localhost;
location / {
proxy_pass http://app:8081;
}
}
За доменом app следит apache со следующим конфигом:
<VirtualHost *:8080>
ServerName 127.0.0.1
DocumentRoot "/app/frontend/web/"
<Directory "/app/frontend/web/">
DirectoryIndex index.html
Require all granted
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</Directory>
LogLevel debug
</VirtualHost>
<VirtualHost *:8081>
ServerName 127.0.0.1
DocumentRoot "/app/api/web/"
<Directory "/app/api/web/">
# use mod_rewrite for pretty URL support
RewriteEngine on
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php
# use index.php as index file
DirectoryIndex index.php
# ...other settings...
# Apache 2.4
Require all granted
## Apache 2.2
# Order allow,deny
# Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:8082>
ServerName 127.0.0.1
DocumentRoot "/app/static/web/"
<Directory "/app/static/web/">
# use mod_rewrite for pretty URL support
RewriteEngine on
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php
# use index.php as index file
DirectoryIndex index.php
# ...other settings...
# Apache 2.4
Require all granted
## Apache 2.2
# Order allow,deny
# Allow from all
</Directory>
</VirtualHost>
Когда я отправляю запрос на my.localhost/api/... я получаю вот такую 500 от apache
В логах следующее:
app_1 | [Thu Feb 25 08:39:46.175271 2021] [authz_core:debug] [pid 16] mod_authz_core.c(820): [client 172.27.0.5:54222] AH01626: authorization result of Require all granted: granted
app_1 | [Thu Feb 25 08:39:46.175332 2021] [authz_core:debug] [pid 16] mod_authz_core.c(820): [client 172.27.0.5:54222] AH01626: authorization result of <RequireAny>: granted
app_1 | [Thu Feb 25 08:39:46.176128 2021] [core:error] [pid 16] [client 172.27.0.5:54222] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
app_1 | [Thu Feb 25 08:39:46.176153 2021] [core:debug] [pid 16] core.c(3833): [client 172.27.0.5:54222] AH00121: r->uri = /index.html
app_1 | [Thu Feb 25 08:39:46.176159 2021] [core:debug] [pid 16] core.c(3840): [client 172.27.0.5:54222] AH00122: redirected from r->uri = /index.html
app_1 | [Thu Feb 25 08:39:46.176164 2021] [core:debug] [pid 16] core.c(3840): [client 172.27.0.5:54222] AH00122: redirected from r->uri = /index.html
app_1 | [Thu Feb 25 08:39:46.176170 2021] [core:debug] [pid 16] core.c(3840): [client 172.27.0.5:54222] AH00122: redirected from r->uri = /index.html
app_1 | [Thu Feb 25 08:39:46.176176 2021] [core:debug] [pid 16] core.c(3840): [client 172.27.0.5:54222] AH00122: redirected from r->uri = /index.html
app_1 | [Thu Feb 25 08:39:46.176183 2021] [core:debug] [pid 16] core.c(3840): [client 172.27.0.5:54222] AH00122: redirected from r->uri = /index.html
app_1 | [Thu Feb 25 08:39:46.176187 2021] [core:debug] [pid 16] core.c(3840): [client 172.27.0.5:54222] AH00122: redirected from r->uri = /index.html
app_1 | [Thu Feb 25 08:39:46.176193 2021] [core:debug] [pid 16] core.c(3840): [client 172.27.0.5:54222] AH00122: redirected from r->uri = /index.html
app_1 | [Thu Feb 25 08:39:46.176199 2021] [core:debug] [pid 16] core.c(3840): [client 172.27.0.5:54222] AH00122: redirected from r->uri = /index.html
app_1 | [Thu Feb 25 08:39:46.176205 2021] [core:debug] [pid 16] core.c(3840): [client 172.27.0.5:54222] AH00122: redirected from r->uri = /index.html
app_1 | [Thu Feb 25 08:39:46.176212 2021] [core:debug] [pid 16] core.c(3840): [client 172.27.0.5:54222] AH00122: redirected from r->uri = /api/
Вопрос, как запрос попадает в app:8080, если должен был быть спроксирован nginx на app:8081?