Reputation: 23
I am trying to setup a reverse proxy using Apache2 on a Centos 8 server.
I currently have nextcloud running on this apache server fine. This is hosted on the domain storage.domain.com
.
I'd like to setup a reverse proxy for the domain proxy.domain.com
to the port 8181
.
My config currently exists in the /etc/httpd/conf.d
directoy.
My reverse proxy file (proxyfile.conf
)is as follows:
ServerName proxy.domain.com
<VirtualHost *:80>
ServerName proxy.domain.com
<Location />
ProxyPass http://127.0.0.1:8181/
ProxyPassReverse http://127.0.0.1:8181/
ProxyPreserveHost On
</Location>
</VirtualHost>
For reference, my nextcloud file (nextcloud.conf
)is as follows:
<VirtualHost *:80>
DocumentRoot /var/www/nextcloud/
ServerName storage.domain.com
Redirect permanent / https://storage.domain.com
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15552000"
</IfModule>
<Directory /var/www/nextcloud/>
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews
<IfModule mod_dav.c>
Dav off
</IfModule>
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =storage.domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
The issue currently is when I go to the domain proxy.domain.com
is that it redirects me to storage.domain.com
.
I was expecting the page at 127.0.0.1:8181
to load when visiting proxy.domain.com
.
Any help would be greatly appreciated. Thank you!
Upvotes: 1
Views: 200