I
I
ironheaddd2020-04-26 22:06:58
Nginx
ironheaddd, 2020-04-26 22:06:58

Bitrix24 and Wordpress: how to set up nginx redirects correctly?

There is a main site on Bitrix24 (CRM + BUS, on the domain.com domain, ip.ad.dr.1 address) and separate pages on Wordpress (on subN.domain.com subdomains, ip.ad.dr.2 address). Now a separate copy of WP has been deployed for each subdomain and the necessary entries on nginx have been added, the whole structure works, but this is not very convenient in terms of administration. I allocated a separate clean machine for WP Multisite, set up multisite, but on a fictitious domain (multisite.com), and all created subdomains, as I understand it, will be of the form sub.multisite.com. When editing the line define('DOMAIN_CURRENT_SITE', 'domain.com'); in the wp-config.php file and reloading the page, the site opens at domain.com/wp-admin and shows a 404 error, which is to be expected. In the nginx config of the main site (/etc/nginx/bx/site_avaliable/ssl.s1.conf) added an entry:

nginx main site

location /wp-admin {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass https://192.168.100.76:443;
proxy_redirect off;
}

Now the actual question is: is it possible to implement my idea at all and how to implement it correctly? What pitfalls can be encountered? How to organize proxying to subdomains?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Amelchenko, 2020-05-06
@i1677960

├── web01.domain.com
│   └── proxy_pass ... <- Битрикс
├── web02.domain.com
│   └── proxy_pass ... <- WP
├── web03.domain.com
│   └── proxy_pass ... <- WP

if it’s very approximate, then such a scheme should be, look towards nginx server blocks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question