solid / solidproject.org

Website for solidproject.org
https://solidproject.org
MIT License
150 stars 103 forks source link

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

Open phochste opened 3 years ago

phochste commented 3 years ago

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
josephguillaume commented 2 years ago

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