Blocked loading mixed active content because of absolute link

Hi,

I finally successfully installed InvoiceNinja on Ubuntu, which reside in Docker (Container Manager) of my DS220 Synology NAS.

I also configured my installation to work with HTTPS. Then I installed a certificate and my NAS forward all HTTP to HTTPS.

Now I ran https://invoice.mondomaine.ch and the request is redirected to https://invoice.mondomaine.ch/setup

The web page is destroy because the CSS file can not be reach

Firedebug, show me that error

Blocked loading mixed active content

Secondely, when I edit the source of the page, I can see this

<script src="[http://yyyy.xxxxxx.ch/vendor/[email protected]/alpine.js](view-source:http://b.eco-sensors.ch/vendor/[email protected]/alpine.js)" defer></script>

We can see HTTP, and for sure that the reason of the problem. I believe, the source of the CSS link are absolute.

My questions

  1. Where are the HTML file? I could edit and add s to the http protocol
  2. Can we change the source links from absolute to relative?

I edit the file
sudo nanao /var/www/invoiceninja/.env

and I modified the line to true
REQUIRE_HTTPS=true
and I restarted my container, but it did not solve the problem.

However, I think, I solved the probem while writting that post
Then I rededit the .env file and I add * to TRUSTED_PROXY=* and that solved the problem!!!

But why?
The * allows all proxy IP addresses, it should not have an IP address or a range?
Should I change back to REQUIRE_HTTPS=false ? (I tried and it is still working with false, why?)

Thanks for the clarification

Hi,

If you know the IP address range being used you can use it instead of *.

We recommend setting REQUIRE_HTTPS to true.

Thanks for your reply

What the correct syntaxe

REQUIRE_HTTPS = "true"
REQUIRE_HTTPS = true

for example debug is with "
APP_DEBUG="true"

Quotations are only needed if the value as a space in it but it’s a best practice to always use them

1 Like