Skip to content

issues setting up apache config for reverse proxy #10

@KBlixt

Description

@KBlixt

I'm trying to set up a document server behind a apache reverse proxy and I'm really stuck. I've tried the configs that's here: https://helpcenter.onlyoffice.com/server/document/document-server-proxy.aspx but to no avail.
I'll just post my config here and maybe someone can point out what I'm doing wrong... all I'm getting when I'm accessing mysite.com/documents is the default page of nextcloud...

nextcloud is hosted on 192.168.0.100:9999 and onlyoffice is working when accessing it on 192.168.0.100:8888

help :(

<IfModule mod_ssl.c>
	<VirtualHost *:80>
		ServerName mysite.com
		ServerAdmin admin
		
		RewriteEngine On

		ProxyRequests     Off
		ProxyPreserveHost On

		ProxyPass "/" "http://127.0.0.1:9999/"
		ProxyPassReverse "/" "http://127.0.0.1:9999/"

		RewriteEngine On
		RewriteCond %{SERVER_PORT} !443
		#RewriteCond %{REQUEST_URI} !^\/login\/flow
		RewriteRule ^(/(.*))?$ https://%{HTTP_HOST}/$1 [R=301,L]
	</VirtualHost>

	<VirtualHost *:443>
		ServerName mysite.com
		ServerAdmin admin

		SSLCertificateFile /filepath/fullchain.pem
		SSLCertificateKeyFile /filepath/privkey.pem
		Include /etc/letsencrypt/options-ssl-apache.conf

		ProxyRequests     Off
		ProxyPreserveHost On

		ProxyPass "/" "http://127.0.0.1:9999/"
		ProxyPassReverse "/" "http://127.0.0.1:9999/"

		<Location /sabnzbd>
			order deny,allow
			deny from all
			allow from all
			ProxyPass http://localhost:8080/sabnzbd
			ProxyPassReverse http://localhost:8080/sabnzbd
		</Location>

		Define VPATH /documents
		Define DS_ADDRESS 192.168.0.100:8888

		<Location ${VPATH}>
			Require all granted
			SetEnvIf Host "^(.*)$" THE_HOST=$1
			RequestHeader setifempty X-Forwarded-Proto http
			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}"

	</VirtualHost>
</IfModule>

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedIssues that need assistance from volunteers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions