Hello there,
I’m trying to move from apache2 because I don’t host a lot of websites, its for mostly my own services and the KISS approach of the caddy is just awesome, my only problem is the Seafile server, I cannot get it to work under Caddy and I cannot find much information about seafile working under caddyV2 on the searches Ive done. Since I’m new with caddy I think here is the best place to fix this problem and ditch apache2.
Here is the apache2 code, works flawlessly:
ServerAdmin *****@*******.eu ServerName files.***********.eu DocumentRoot /var/www/files.***********eu/html
RewriteEngine on
Some rewrite rules in this file were disabled on your HTTPS site,
because they have the potential to create redirection loops.
RewriteCond %{SERVER_NAME} =files.************.eu [OR]
RewriteCond %{SERVER_NAME} =www.files.*********.eu
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
Include /etc/letsencrypt/options-ssl-apache.conf
ServerAlias www.files.*************.eu
SSLCertificateFile /etc/letsencrypt/live/files.eu/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/files..eu/privkey.pemAlias /media /opt/seafile/seafile-server-latest/seahub/media
<Location /media> Require all granted </Location> # seafile fileserver ProxyPass /seafhttp http://127.0.0.1:8082 ProxyPassReverse /seafhttp http://127.0.0.1:8082 RewriteEngine On RewriteRule ^/seafhttp - [QSA,L] # seahub web interface SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 ProxyPass / http://127.0.0.1:8000/ ProxyPassReverse / http://127.0.0.1:8000/
I know that I need to reverse proxy. but the problem is how can I redirect the /seafhttp to the fileserver and how can I point the media location of seahub in Caddy? Tried somethings but I’m kinda lost.
The server is running Debian 10 buster with kernel 5.6.
Thank you and Hope you have a nice weekend