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

Proxying nginx behind Apache <-> Nextcloud #381

Open
masscream opened this issue Apr 28, 2022 · 1 comment
Open

Proxying nginx behind Apache <-> Nextcloud #381

masscream opened this issue Apr 28, 2022 · 1 comment

Comments

@masscream
Copy link

masscream commented Apr 28, 2022

Hello, this issue looks simple but I can't get around it. I went through a lot of tutorials and config examples but none of them brought me to success. I run things on Apache / http setup (ssl is added through external ProxyPass, does not matter much in the issue) - Nextcloud, Onlyoffice, also Nginx - which I was kind of forced to install because of Oo. I couldn't find alternate config for Apache on the internet. Therefore Apache is running on port 80, Nginx 81 and I use virtual paths for everything. e.g.
http://www.hostname.hs/nextcloud. My intention is to create one for Oo too, but there goes the struggle. I was able to put together a config for Apache which is passing the requests correctly to Nginx, but Nginx doesn't care and follows everywhere its own path. I tried adding the config also (and also only) for nginx but except "duplicate configs" and "outside locations" conflicts in its complex hostfiles, I could not get it to work.

Apache config

#OnlyOffice
	Define VPATH /onlyoffice
        Define DS_ADDRESS localhost:81

        <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}"

Therefore http://www.hostname.hs/onlyoffice/ brings me correctly to main page http://www.hostname.hs/onlyoffice/welcome/ but there, when I hit "Go to test example", nginx forwards me only to http://www.hostname.hs/example/, which is not valid. I do not have to say that probably due to this, also my NC connector is not working and isn't opening my documents correctly. If there's another issue as well, I may find out after successful virtual path creation. Thanks for any ideas.

P.S. I have used the official tutorial, but nothing was mentioned there about altering any of the nginx config files.

@masscream
Copy link
Author

I actually misplaced this issue, this repo would be much more suitable. Anyway, I gave up, I needed to get it working, therefore I configured my Apache for a brand new Virtualhost - onlyoffice.hostname.hs which is working now correctly, just with a little troubleshooting. The question stays - Is it possible to use onlyoffice with the virtual path and/or rewrite its base config files for the use with the Apache server (get rid of nginx)?

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