Skip to content

Instantly share code, notes, and snippets.

Last active March 12, 2021 13:18
Show Gist options
  • Save jhass/719014 to your computer and use it in GitHub Desktop.
Save jhass/719014 to your computer and use it in GitHub Desktop.
Advanced Diaspora Apache reverse proxy
# Make sure to notice the comments at
<VirtualHost *:80>
RedirectPermanent /
<VirtualHost *:443>
DocumentRoot /home/diaspora/diaspora/public
RewriteEngine On
RewriteCond %{HTTP_HOST} !^diaspora\.example\.org [NC]
RewriteRule ^/(.*)$ https://diaspora\.example\.org/$1 [L,R,QSA]
# For Camo support
#RewriteRule ^/camo/(.*)$ balancer://camo/$1 [P,QSA,L]
RewriteRule ^/(.*)$ balancer://upstream%{REQUEST_URI} [P,QSA,L]
<Proxy balancer://upstream>
# Recommended, using a unix socket (Requires Apache >= 2.4)
BalancerMember unix:///path/to/diaspora/tmp/diaspora.sock|http://
# Alternatively let diaspora listen on a local port (Use this for Apache < 2.4)
# BalancerMember http://localhost:3000
# For Camo support
#<Proxy balancer://camo>
# BalancerMember http://localhost:8081
ProxyRequests Off
ProxyVia On
ProxyPreserveHost On
RequestHeader set X_FORWARDED_PROTO https
<Proxy *>
# Apache < 2.4
#Order allow,deny
#Allow from all
# Apache >= 2.4
Require all granted
<Directory /home/diaspora/diaspora/public>
Options -MultiViews
# Apache < 2.4
#Allow from all
#AllowOverride all
# Apache >= 2.4
Require all granted
SSLEngine On
SSLCertificateFile /path/to/cert
SSLCertificateKeyFile /path/to/private_key
# For Let's encrypt it should point to /etc/letsencrypt/live/
SSLCertificateChainFile /path/to/chain_file
# Based on - consider as global configuration
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
SSLHonorCipherOrder off
SSLSessionTickets off
Copy link

Hi, I am in the process of installing diaspora and setting apache up. Is there any way of nstalling diaspora purely on localhost without any networking or hosting? I want to get a basic idea how it is to work with ROR before I go any further. Thanks.

Copy link

jhass commented Jan 22, 2021

@heatherita A development setup of diaspora does not need a reverse proxy setup, you just access http://localhost:3000 directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment