diff --git a/deploy/funkwhale_proxy.conf b/deploy/funkwhale_proxy.conf
new file mode 100644
index 0000000000000000000000000000000000000000..1b1dd0d20e951455eb999e17aacc1c45e6fed669
--- /dev/null
+++ b/deploy/funkwhale_proxy.conf
@@ -0,0 +1,13 @@
+# global proxy conf
+proxy_set_header Host $host;
+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_set_header X-Forwarded-Host   $host:$server_port;
+proxy_set_header X-Forwarded-Port   $server_port;
+proxy_redirect off;
+
+# websocket support
+proxy_http_version 1.1;
+proxy_set_header Upgrade $http_upgrade;
+proxy_set_header Connection $connection_upgrade;
diff --git a/deploy/nginx.conf b/deploy/nginx.conf
index 125fbc6d4190b98e35032b98b0e7ad0c07644892..1c7b9ae8357d8222aba78e9c6dc34f45fbbb8ca4 100644
--- a/deploy/nginx.conf
+++ b/deploy/nginx.conf
@@ -48,20 +48,6 @@ server {
 
     root /srv/funkwhale/front/dist;
 
-    # global proxy conf
-    proxy_set_header Host $host;
-    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_set_header X-Forwarded-Host   $host:$server_port;
-    proxy_set_header X-Forwarded-Port   $server_port;
-    proxy_redirect off;
-
-    # websocket support
-    proxy_http_version 1.1;
-    proxy_set_header Upgrade $http_upgrade;
-    proxy_set_header Connection $connection_upgrade;
-
     location / {
         try_files $uri $uri/ @rewrites;
     }
@@ -70,6 +56,7 @@ server {
         rewrite ^(.+)$ /index.html last;
     }
     location /api/ {
+        include /etc/nginx/funkwhale_proxy.conf;
         # this is needed if you have file import via upload enabled
         client_max_body_size 30M;
         proxy_pass   http://funkwhale-api/api/;
@@ -89,6 +76,7 @@ server {
 
     # Transcoding logic and caching
     location = /transcode-auth {
+        include /etc/nginx/funkwhale_proxy.conf;
         # needed so we can authenticate transcode requests, but still
         # cache the result
         internal;
@@ -97,14 +85,13 @@ server {
         if ($request_uri ~* "[^\?]+\?(.*)$") {
             set $query $1;
         }
-        proxy_set_header X-Forwarded-Host   $host:$server_port;
-        proxy_set_header X-Forwarded-Port   $server_port;
         proxy_pass http://funkwhale-api/api/v1/trackfiles/viewable/?$query;
         proxy_pass_request_body off;
         proxy_set_header        Content-Length "";
     }
 
     location /api/v1/trackfiles/transcode/ {
+        include /etc/nginx/funkwhale_proxy.conf;
         # this block deals with authenticating and caching transcoding
         # requests. Caching is heavily recommended as transcoding
         # is a CPU intensive process.
diff --git a/docs/installation/index.rst b/docs/installation/index.rst
index 218049dd10ab5b2df7c27d4e2dd9658f52e22ec0..2e62c71ec5b547da9a9fcd4db7a4566ff9814b57 100644
--- a/docs/installation/index.rst
+++ b/docs/installation/index.rst
@@ -59,10 +59,11 @@ Ensure you have a recent version of nginx on your server. On debian-like system,
     apt-get update
     apt-get install nginx
 
-Then, download our sample virtualhost file:
+Then, download our sample virtualhost file and proxy conf:
 
 .. parsed-literal::
 
+    curl -L -o /etc/nginx/funkwhale_proxy.conf "https://code.eliotberriot.com/funkwhale/funkwhale/raw/|version|/deploy/funkwhale_proxy.conf"
     curl -L -o /etc/nginx/sites-enabled/funkwhale.conf "https://code.eliotberriot.com/funkwhale/funkwhale/raw/|version|/deploy/nginx.conf"
 
 Ensure static assets and proxy pass match your configuration, and check the configuration is valid with ``nginx -t``. If everything is fine, you can restart your nginx server with ``service nginx restart``.