I have setup peertube in production and the UI is running fine …i am able to register a user
My domain point to server’s ngnix proxy manager where it points to peertube instance running at port 9000.
However i am getting below error when the user is trying to upload a video
polyfills.8a8facddc202dac1.js:1 Mixed Content: The page at ‹ https://xxx.online/videos/upload#upload › was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint ‹ http://xxx.online/api/v1/videos/upload-resumable?upload_id=af63af4c8601a015-69f538c38e4ff433-ee82a02043535609-7194dbe314dbede4 ›. This request has been blocked; the content must be served over HTTPS.
My docker compose As below:
version: « 3.3 »
#restart: « always »
You should set
PEERTUBE_WEBSERVER_HTTPS to true in your env file.
i tried setting this property to true but still it does not work… any other way to change this setting and force?
Maybe the env files is stored on disk at first startup.
I’m not very familiar with the Docker setup.
If your Peertube is empty, you can try delete all docker volumes, and recreate them.
If you don’t want to delete your setup, you can try this:
- go in the folder where you have your docker-compose
- launch bash inside the peertube container:
docker-compose exec -u root peertube bash
- Check the following files:
If file exists, there should contain this value:
vi are not installed in the container. You have to use
cat to read files, and install your prefered editor, for example:
apt update && apt install vim
Please note that this is at your own risk. I’m not familiar enought with the docker production setup. Maybe these files could be respawned on peertube update. If you can, prefer the first solution: delete and start again.
I tried remove the docker-volume folder and re-run with PEERTUBE_WEBSERVER_HTTPS=true but still same error…
i logged into the container and got below values
# echo $NODE_ENV
# echo $PEERTUBE_WEBSERVER_HTTPS
i see below list of files in container /app/config path
-rw-r–r-- 1 peertube peertube 2406 Sep 24 14:46 test.yaml
-rw-r–r-- 1 peertube peertube 765 Sep 24 14:46 test-6.yaml
-rw-r–r-- 1 peertube peertube 765 Sep 24 14:46 test-5.yaml
-rw-r–r-- 1 peertube peertube 765 Sep 24 14:46 test-4.yaml
-rw-r–r-- 1 peertube peertube 765 Sep 24 14:46 test-3.yaml
-rw-r–r-- 1 peertube peertube 850 Sep 24 14:46 test-2.yaml
-rw-r–r-- 1 peertube peertube 851 Sep 24 14:46 test-1.yaml
-rw-r–r-- 1 peertube peertube 29819 Sep 24 14:46 production.yaml.example
-rw-r–r-- 1 peertube peertube 1790 Sep 24 14:46 dev.yaml
-rw-r–r-- 1 peertube peertube 29013 Sep 24 14:46 default.yaml
the default.yaml have https: false , while production.yaml.example have https: true
the files /app/support/docker/production/config/custom-environment-variables.yaml have below values
hostname: « PEERTUBE_WEBSERVER_HOSTNAME »
__name: « PEERTUBE_WEBSERVER_PORT »
__format: « json »
__name: « PEERTUBE_WEBSERVER_HTTPS »
__format: « json »
Not sure which values is being refereed and why it still does http… not sure why env variables are not being consider any other way to pass the config?
any other way to fix this issue?
Sorry, i don’t know. Hoping someone else has a solution.
Please see Uploading a video fails because it tries to use http instead of https. · Issue #4990 · Chocobozzz/PeerTube · GitHub
I think your proxy doesn’t correctly forward the
x-forwarded-proto header so PeerTube doesn’t provide the correct URL proto redirection when you upload a file.
Thanks this was the issue it seems…its working fine now
i tried this earlier but seems ngnix proxy manager have different section to add this setting .
« Please note, that any add_header or set_header directives added here will not be used by nginx. You will have to add a custom location ‹ / › and add the header in the custom config there. »
Thus i added
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
In custom location with /
It looks like below: