72 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
			
		
		
	
	
			72 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
upstream fw {
 | 
						|
    # depending on your setup, you may want to update this
 | 
						|
    server ${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT};
 | 
						|
}
 | 
						|
map $http_upgrade $connection_upgrade {
 | 
						|
    default upgrade;
 | 
						|
    ''      close;
 | 
						|
}
 | 
						|
 | 
						|
server {
 | 
						|
    listen 80;
 | 
						|
    listen [::]:80;
 | 
						|
    server_name ${FUNKWHALE_HOSTNAME};
 | 
						|
    location / { return 301 https://$host$request_uri; }
 | 
						|
}
 | 
						|
server {
 | 
						|
    listen      443 ssl;
 | 
						|
    listen [::]:443 ssl;
 | 
						|
    server_name ${FUNKWHALE_HOSTNAME};
 | 
						|
 | 
						|
    # TLS
 | 
						|
    ssl_protocols TLSv1.2;
 | 
						|
    ssl_ciphers HIGH:!MEDIUM:!LOW:!aNULL:!NULL:!SHA;
 | 
						|
    ssl_prefer_server_ciphers on;
 | 
						|
    ssl_session_cache shared:SSL:10m;
 | 
						|
    ssl_certificate     /etc/letsencrypt/live/${FUNKWHALE_HOSTNAME}/fullchain.pem;
 | 
						|
    ssl_certificate_key /etc/letsencrypt/live/${FUNKWHALE_HOSTNAME}/privkey.pem;
 | 
						|
 | 
						|
    # HSTS
 | 
						|
    add_header Strict-Transport-Security "max-age=31536000";
 | 
						|
 | 
						|
    # compression settings
 | 
						|
    gzip on;
 | 
						|
    gzip_comp_level    5;
 | 
						|
    gzip_min_length    256;
 | 
						|
    gzip_proxied       any;
 | 
						|
    gzip_vary          on;
 | 
						|
 | 
						|
    gzip_types
 | 
						|
        application/atom+xml
 | 
						|
        application/javascript
 | 
						|
        application/json
 | 
						|
        application/ld+json
 | 
						|
        application/activity+json
 | 
						|
        application/manifest+json
 | 
						|
        application/rss+xml
 | 
						|
        application/vnd.geo+json
 | 
						|
        application/vnd.ms-fontobject
 | 
						|
        application/x-font-ttf
 | 
						|
        application/x-web-app-manifest+json
 | 
						|
        application/xhtml+xml
 | 
						|
        application/xml
 | 
						|
        font/opentype
 | 
						|
        image/bmp
 | 
						|
        image/svg+xml
 | 
						|
        image/x-icon
 | 
						|
        text/cache-manifest
 | 
						|
        text/css
 | 
						|
        text/plain
 | 
						|
        text/vcard
 | 
						|
        text/vnd.rim.location.xloc
 | 
						|
        text/vtt
 | 
						|
        text/x-component
 | 
						|
        text/x-cross-domain-policy;
 | 
						|
 | 
						|
    location / {
 | 
						|
        include /etc/nginx/funkwhale_proxy.conf;
 | 
						|
        client_max_body_size ${NGINX_MAX_BODY_SIZE};
 | 
						|
        proxy_pass   http://fw/;
 | 
						|
    }
 | 
						|
}
 |