Page 1 of 1

How Fix Mixed Content | proxypass nginx

Posted: 07 Aug 2015, 20:05
by 3tcetera

How i have some trouble for redirect my http://sub.domaine.tld to https://sub.domaine.tld . I use nginx with proxypass on a Debian jessie (server) and java version "1.8.0_51, a domain name + certficat ssl signed by startssl :


Code: Select all

# cat /etc/nginx/sites-enabled/madsonic.conf 

upstream madsonic {

server {
  listen                     80;
 	server_name                sub.domaine.tld;
        return 301 https://$server_name$request_uri;

server {
  listen 443 ssl;
  server_name sub.domaine.tld;
  client_max_body_size 200M;
   ssl on;
    ssl_certificate /etc/nginx/keys/;
    ssl_certificate_key /etc/nginx/keys/;
  include /etc/nginx/conf.d/ciphers.conf;
        access_log /var/log/nginx/madsonic-access.log combined;
	error_log /var/log/nginx/madsonic-error.log error;

    # proxy to madsonic app
  location / {
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header  X-Forwarded-Server $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-Host $server_name;



Code: Select all

# cat /etc/default/madsonic

MADSONIC_ARGS="--init-memory=512 --max-memory=1024 --default-upload-folder=/home/USER/media/incoming --default-podcast-folder=/home/USER/media/podcast --default-playlist-import-folder=/home/USER/m$


https for only listen music work fine because this no required to call a js script.
But the problem is when would eg. edit settings or any other action who need to call a js script, my browser ( FF or Chromiun ) block the script because : Mixed Content
There is no rules to rewrite this in https :roll:
Mixed Content: The page at '' was loaded over HTTPS, but requested an insecure resource ''. This request has been blocked; the content must be served over HTTPS.
Is here a way to fix this ?

Another french guy who need to learn english

Re: How Fix Mixed Content | proxypass nginx

Posted: 27 Nov 2015, 14:20
by kiv
I have exactly the same problem and no solution to solve this.

For the moment I just told firefox to show mixed content : "about:config, and turn off the

Code: Select all

I thought many people served their madsonic behind a reverse proxy and wrote solution for this, maybe I didn't search properly...

Yet another french guy struggling with english ;)

Re: How Fix Mixed Content | proxypass nginx

Posted: 27 Nov 2015, 15:19
by kiv
I think I have found a solution :

In your host, edit the nginx conf file of your VM or container : in location / {

Code: Select all

proxy_redirect http:// $scheme://;
And of course, reload nginx config ;)