A
A
azesmhook2019-11-01 12:50:38
Apache HTTP Server
azesmhook, 2019-11-01 12:50:38

Why does Bitrix give absolute links to infoblock sections in the admin panel?

Good afternoon.
I have a problem.
The bottom line is this:
There is a VDS, Apache is on port 80. There is an old site with PHP 5.4, and it was necessary to install a new site with PHP 7.2 on Bitrix.
I decided to install a docker container with Apache and deploy the site there. The docker container lies on port 8080, inside the container this port is mapped to port 80, Apache, respectively, listens to it.
The problem is that in Bitrix, in the admin panel, in the content, when you select the info block section in the left menu, everything is OK, but if you select it directly in the list of sections in the admin panel, then it issues absolute links from http://localhost:8080. Moreover, references to elements in the same place are issued normally - they are relative.
Apache external config:

<VirtualHost *:80>
        ServerName new.example.ru
        <Proxy *>
                Allow from localhost
        </Proxy>
        ProxyPass / http://localhost:8080/
        ProxyPassReverse / http://localhost:8080/
</VirtualHost>

Apache internal config:
<VirtualHost *:80> 
    ServerAdmin [email protected] 
    DocumentRoot "/var/www/html" 
    ServerName localhost 
        <Directory "/var/www/html/"> 
                AllowOverride all 
        </Directory> 
</VirtualHost>

docker-compose.yml:
version: "3"
services:
webserver:
build:
context: ./bin/webserver
container_name: '7.2.x-webserver'
restart: 'always'
ports:
- "${HOST_MACHINE_UNSECURE_HOST_PORT}:80"
- "${HOST_MACHINE_SECURE_HOST_PORT}:443"
links:
- mysql
volumes:
- ${DOCUMENT_ROOT-./www}:/var/www/html
- ${PHP_INI-./config/php/php.ini}:/usr/local /etc/php/php.ini
- ${VHOSTS_DIR-./config/vhosts}:/etc/apache2/sites-enabled
- ${LOG_DIR-./logs/apache2}:/var/log/apache2
mysql:
build:
context: "./bin/${DATABASE}"
container_name: '5.7-mysql'
restart: 'always'
ports:
- "${HOST_MACHINE_MYSQL_PORT}:3306"
volumes:
- ${MYSQL_DATA_DIR-./data/mysql}:/ var/lib/mysql
- ${MYSQL_LOG_DIR-./logs/mysql}:/var/log/mysql
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
5dbbfef465029002163437.png
I I know how to forward the hostname, but I don’t know how to display links without port 8080. Do not crutch the admin files. This will be a fallback.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question