@Rusangl

Как правильно использовать ProxyPass и ProxyPassReverse в apache2?

Пробую подключить чат JSCX в Nextcloud к собственному XMPP-серверу. На XMPP-сервере (из той же локальной сети) настроен и доступен BOSH по адресу https://example.com:5281/http-bind .

Как сделать так, чтобы https://example.com:5281/http-bind был доступен по адресу https://example.com/http-bind ?

Согласно мануалу нужно прописать вот так:
ProxyPass /http-bind/ example.com:5280/http-bind
ProxyPassReverse /http-bind/ example.com:5280/http-bind

Но как и куда конкретно прописывать?
В /etc/apache2/sites-available/ лежат 3 файла:
1) 000-default.conf:
spoiler
<VirtualHost _default_:80>
  DocumentRoot /var/www/nextcloud
   <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
   </IfModule>
</VirtualHost>

2) default-ssl.conf:
spoiler
<IfModule mod_ssl.c>
        <VirtualHost _default_:443>
                ServerAdmin webmaster@localhost
                DocumentRoot /var/www/html
                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined
                SSLEngine on
                SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
                SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>
                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars
                </Directory>
        /VirtualHost>
</IfModule>

3) и example.conf:
spoiler
<IfModule mod_ssl.c>
  <VirtualHost _default_:443>
    DocumentRoot /var/www/nextcloud
ServerName example.com
    CustomLog /var/log/apache2/nc-access.log combined
    ErrorLog  /var/log/apache2/nc-error.log
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
  </VirtualHost>
  <Directory /var/www/nextcloud/>
    Options +FollowSymlinks
    AllowOverride All
    <IfModule mod_dav.c>
      Dav off
    </IfModule>
    LimitRequestBody 0
    SSLRenegBufferSize 10486000
  </Directory>
</IfModule>



Буду очень признателен за совет. Пока, к сожалению, с apache2 подружиться не удалось, ничего иного кроме стартовой страницы https://example.com не загружается.
  • Вопрос задан
  • 39 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы