Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken docs about webui proxy #670

Open
frank42hh opened this issue Sep 5, 2023 · 0 comments
Open

Fix broken docs about webui proxy #670

frank42hh opened this issue Sep 5, 2023 · 0 comments

Comments

@frank42hh
Copy link

Hi,
I tried to add my rspamd webui to my apache webserver via proxy as described in https://github.com/rspamd/rspamd.com/blob/master/doc/faq.md#how-to-use-the-webui-behind-a-proxy-server, but after several fails I realized that the docs are wrong here.

First of all the minor problem: I suggest do replace the Location block in apache config:

<Location /rspamd>
	Order allow,deny
	Allow from all
</Location>

with a version that works for apache2 as well as with the newer ones, because the current faq entry doesn't reflect the new syntax:

<Location /rspamd>
 <IfVersion >= 2.3>
      Require all granted
  </IfVersion>
  <IfVersion < 2.3>
      Order allow,deny
      Allow from all
  </IfVersion>
</Location>

Sadly, for the second problem I don't have a fix at hand, because I'm not sure if this is fixable by docs or must fixed in the code.
Currently, the docs say

RewriteRule ^/rspamd$ /rspamd/ [R,L]
RewriteRule ^/rspamd/(.*) http://localhost:11334/$1 [P,L]

Problem is, that this doesn't work for the webui. The main page does indeed get loaded, but all referrals (like the logo image, the css stylesheets etc) are broken. I think this is because (for example) the logo is referenced in the code as
<img src="./img/rspamd_logo_navbar.png" alt="Rspamd">
Because of the ./ in the beginning of the URI, the browser tries to open https://hostname.domain.tld/img/rspamd_logo_navbar.png instead of https://hostname.domain.tld/rspamd/img/rspamd_logo_navbar.png, which makes the webui unusable.

Also, using proxy is also available for apache, e.g.

	ProxyPass "http://localhost:11334/"
	ProxyPassReverse "http://localhost:11334/"

but this also fails due to the above mentioned URL problem. Currently, the only solution is to place the webui proxy into a separate <VirtualHost> container where you can omit the /rspamd location.

I hope it's clear what I'm trying to report, if not, don't hesitate to ask for more input :)

Frank

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant