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

Onlyoffice behind Apache reverse proxy and owncloud #108

Closed
r4a5a88 opened this issue Oct 12, 2017 · 10 comments
Closed

Onlyoffice behind Apache reverse proxy and owncloud #108

r4a5a88 opened this issue Oct 12, 2017 · 10 comments

Comments

@r4a5a88
Copy link

r4a5a88 commented Oct 12, 2017

Hi Community,

I installed onlyoffice on a Server behind a apache revese proxy.
due to the server having multiple other websites behind it including an owncloud I can't put onlyoffice on /
I put it ot /onlyoffice but the onlyoffice server alway redirects it to /welcome , which I added in the proxy but then it tells me : "Something went wrong during installation"
I tried to apply the apache configuration from the onlyoffice website but it didn't work.
When I entered the website I got hostname , hostename/welcome
Is ther a configration file or spot in the database where I can change the sitename?

@alexeybannov
Copy link
Member

You can more details with an example config for Apache to describe the problem? In Docker we used as a proxy server with nginx https://github.com/ONLYOFFICE/docker-onlyoffice-owncloud/blob/master/nginx.conf.

@agolybev
Copy link

Hi @r4a5a88,
You can see how to install documentserver in virtual path here.

@r4a5a88
Copy link
Author

r4a5a88 commented Oct 12, 2017

hi @agolybev
I used that configuration on my server.
It didn't work

@r4a5a88
Copy link
Author

r4a5a88 commented Oct 12, 2017

thats the apache conf for the onlyoffice site and a test-owncloud i am using to test it

Alias testcloud /testcloud
Alias onlyoffice /onlyoffice

#SetEnvIf Host "^(.*)$" THE_HOST=$1
#RequestHeader setifempty X-Forwarded-Proto https
#RequestHeader setifempty X-Forwarded-Host %{THE_HOST}e
#ProxyAddHeaders Off

ProxyPass /testcloud http://192.168.13.75/owncloud
    	ProxyPassReverse /testcloud http://192.168.13.75/owncloud

		
		
ProxyPassMatch (.*)(\/websocket)$ "ws://192.168.13.74/onlyoffice/$1$2"
ProxyPass /onlyoffice "http://192.168.13.74/"
ProxyPassReverse /onlyoffice "http://192.168.13.74"
ProxyPass	/welcome	http://192.168.13.74/welcome
ProxyPassReverse	/welcome http://192.168.13.74/welcome

@agolybev
Copy link

@r4a5a88
Fisrt I'm not sure for

Alias testcloud /testcloud
Alias onlyoffice /onlyoffice

Because you use this key word below in the config
Next, this statements are required:

  SetEnvIf Host "^(.*)$" THE_HOST=$1
  RequestHeader setifempty X-Forwarded-Proto http
  RequestHeader setifempty X-Forwarded-Host %{THE_HOST}e
  RequestHeader edit X-Forwarded-Host (.*) $1${VPATH}
  ProxyAddHeaders Off

Finaly, I think you don't have to proxy welcome path by this:

ProxyPass	/welcome	http://192.168.13.74/welcome
ProxyPassReverse	/welcome http://192.168.13.74/welcome

@agolybev
Copy link

agolybev commented Oct 12, 2017

Try using this config (it's based on this config example):

Listen 80
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
LoadModule headers_module modules/mod_headers.so
LoadModule setenvif_module modules/mod_setenvif.so

<IfModule unixd_module>
  User daemon
  Group daemon
</IfModule>

Define VPATH /onlyoffice
Define DS_ADDRESS 192.168.13.74

<Location ${VPATH}>
  Require all granted
  SetEnvIf Host "^(.*)$" THE_HOST=$1
  RequestHeader setifempty X-Forwarded-Proto http
  RequestHeader setifempty X-Forwarded-Host %{THE_HOST}e
  RequestHeader edit X-Forwarded-Host (.*) $1${VPATH}
  ProxyAddHeaders Off
</Location>

ProxyPassMatch ^\${VPATH}(.*)(\/websocket)$ "ws://${DS_ADDRESS}/$1$2"
ProxyPass ${VPATH} "http://${DS_ADDRESS}/"
ProxyPassReverse ${VPATH} "http://${DS_ADDRESS}/"

It won't proxy to owncloud, but you can test proxying to the documentserver.

@r4a5a88
Copy link
Author

r4a5a88 commented Oct 13, 2017

thanks for the conf.
It works. I get a green screen.
One more problem. In my cloud , when I open a document , I only see a white screen.

@r4a5a88 r4a5a88 closed this as completed Oct 13, 2017
@r4a5a88 r4a5a88 reopened this Oct 13, 2017
@r4a5a88
Copy link
Author

r4a5a88 commented Oct 13, 2017

grafik

@agolybev
Copy link

agolybev commented Oct 13, 2017

Hi @r4a5a88.
Yes this config is suitable only for HTTP traffic. Try changing string RequestHeader setifempty X-Forwarded-Proto http to RequestHeader setifempty X-Forwarded-Proto https for proxing HTTPS traffic.

@r4a5a88
Copy link
Author

r4a5a88 commented Oct 13, 2017

Vielen Herzlichen Dank @agolybev
Es funktioniert :)

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

No branches or pull requests

4 participants