-
Notifications
You must be signed in to change notification settings - Fork 1
Examples nginx, apache
This Example will show you both, how to serve the songs publicly and how to host this instance behind a reverse proxy!
- A server
- A domain (technically optional)
- A static IP (You can check out Cloudflare's Documentation for dynamic IP's)
- IPv6 (Optional) Check here or
curl -6 ifconfig.me
. An IPv6 Address looks something like this:2345:0425:2CA1:0000:0000:0567:5673:23b5
- nginx (should be obvious)
- certbot or similair (Optional, but recommended)
pacman -S nginx certbot certbot-nginx
apt install nginx certbot python3-certbot-nginx
Note
I personally use /srv/sfh/songs to store and serve the songs, but this can be changed to any directory you like.
# SFH mirror software reverse proxy
server {
server_name <your-domain.name>;
# Only enable, if you have IPv6! Check here: http://ifconfig.me
# listen [::]:80;
# listen [::]:443;
listen 80;
listen 443;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:58532/;
proxy_buffering on;
proxy_redirect off;
# websocket
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
# Public song host
server {
server_name <your-domain.name>;
listen 80;
# Only enable, if you have IPv6! Check here: http://ifconfig.me
# listen [::]:80;
# listen [::]:443;
listen 443;
root /srv/sfh/songs;
autoindex on;
}
Important
You should definitely use certbot or something similair, to secure your website/s.
You can do this by running certbot --nginx
and following the instructions on screen
To actually get the songs in the correct directory, you could run ln -s directory/of/sfh-mirror/repo/songs /srv/sfh/songs
and make the folder owned by the user the sfh mirror is actually running on: chown user:user /srv/sfh/songs
. To check your username, you can simply run whoami
.
- A server
- A domain (technically optional)
- A static IP (You can check out Cloudflare's Documentation for dynamic IP's)
- IPv6 (Optional) Check here or
curl -6 ifconfig.me
. An IPv6 Address looks something like this:2345:0425:2CA1:0000:0000:0567:5673:23b5
- apache (should be obvious)
- certbot or similair (Optional, but recommended)
pacman -S apache certbot certbot-apache
apt install apache2 certbot python3-certbot-apache
Note
Still has to be documented, since I (@PassiHD2004) am not very experienced with apache!