solidproject.org icon indicating copy to clipboard operation
solidproject.org copied to clipboard

Using Apache as a Reverse Proxy mentions settings for the wrong server

Open phochste opened this issue 4 years ago • 1 comments

Search terms you've used

is:issue Apache

What problem are you trying to solve? Please describe.

The documentation of Running Community Solid Server mentions on the right side that it is about Running Community Solid Server but in reality the settings provided are for the Node Solid Server. These settings will not work for the Solid Server.

What existing documentation is relevant to your problem, and why is it insufficient?

In the current version one needs help from Solid developers to setup a reverse proxy for the Solid Server.

Here is an example of a Apache configuration that will work for running the community solid server.

<VirtualHost *:443>
    ServerName solid.example

    .
    . (snip)
    .

    RewriteEngine

    # Pass the host and protocol
    RequestHeader set X-Forwarded-Host solid.example
    RequestHeader set X-Forwarded-Proto https

    # Delegate to the Solid server
    ProxyPreserveHost On
    ProxyPass / http://localhost:3000/
    ProxyPassReverse / http://localhost:3000/

    # Enable websockets
    RewriteCond %{HTTP:Upgrade} websocket [NC]
    RewriteCond %{HTTP:Connection} upgrade [NC]
    RewriteRule ^/?(.*) "ws://localhost:3000/$1" [P,L]

    .
    . (snip)
    .
</VirtualHost>

The SSL setting below are for the NSS server and not required for running a CSS server:

SSLProxyEngine On
SSLProxyVerify None
SSLProxyCheckPeerCN Off
SSLProxyPeerName Off
SSLProxyCheckPeerExpire Off

phochste avatar Oct 04 '21 13:10 phochste

Confirming I needed X-Forwarded-Proto in particular, as CSS doesn't recognise https URIs as being served by a http baseUrl, and raises an SSL error if a https baseUrl is specified.

RequestHeader also needed enabling the headers module, in my case using a2enmod headers

josephguillaume avatar Nov 07 '21 07:11 josephguillaume