O
O
oziside2021-02-24 16:35:44
Nginx
oziside, 2021-02-24 16:35:44

reverse proxy nginx. How to open bitrix by subdirectory link?

Good afternoon!

Faced the following problem. There are two containers:
1. React application
2. Bek, which is written in Bitrix (the final CMS is not important, it can be WP)

Accordingly, two docker containers are launched:

- React is located at: http://ip_server_address:8081/
- Bek ( bitrix) is located at: http://ip_server_address:8082/ there is an example.com

domain where the React application is opened. I need Bitrix to open at example.com/api I use jwilder/nginx-proxy , whose configuration file looks like this:





server {
  listen 80;
  server_name example.com;
  
    location / {
        proxy_pass http://ip_адрес_сервера:8081/
    }

    location /api/ {
      proxy_pass http://ip_адрес_сервера:8082/
    }
}


Going to example.com correctly opens the React application, but at example.com/api , the Bitrix page opens, but static files are not pulled up, since they still refer to example.com , and not to example.com/api (screenshot )

603655643d601772993130.png

I can’t solve this issue which day, if anyone had a similar experience (not necessarily a site on Bitrix), I will be glad to help, thanks!

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