Home Forums Support 404 with require_https and cloudflare

This topic contains 8 replies, has 3 voices, and was last updated by  bbrendon 2 weeks, 5 days ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #19567

    CMAW
    Participant

    My site is using a subdomain for invoice ninja http://invoice.mywebsite.com

    The site is hosted with GoDaddy on a shared server.

    I have a Cloudflare A record configured to point to my host IP which will serve the website over HTTPS

    As soon as I turn on REQUIRE_HTTPS=true in .env – I am unable to access the site over HTTPS.

    The APP_URL in .env is set to https://invoice.mywebsite.com

    My site works absolutely fine over HTTP

    Can anyone help?

    #19568

    CMAW
    Participant

    Almost able to resolve my own issue

    Changed Cloudflare SSL type from Full to Flexible

    I get an error:
    ERR_TOO_MANY_REDIRECTS

    If I change TRUSTED_PROXIES in env to TRUSTED_PROXIES=”*” it then works over HTTPS however not recommended

    Can anyone advise how this can be secured?

    #19570

    Hillel Coren
    Keymaster

    If you know the IPs you could specify them rather than use *

    #19571

    CMAW
    Participant

    Hi Hillel, I tried this but got the same issue

    I’m not too familiar with Laravel – perhaps the syntax is incorrect?

    TRUSTED_PROXIES=”103.21.244.0/22″,”103.22.200.0/22″,”103.31.4.0/22″,”104.16.0.0/12″,”108.162.192.0/18″,”131.0.72.0/22″,”141.101.64.0/18″,”162.158.0.0/15″,”172.64.0.0/13″,”173.245.48.0/20″,”188.114.96.0/20″,”190.93.240.0/20″,”197.234.240.0/22″,”198.41.128.0/17″

    #19572

    Hillel Coren
    Keymaster

    I think you have too many quotes, it should be “ip,ip,ip,…”

    #19573

    CMAW
    Participant

    Tried that also but same issue

    I will continue to work on a solution and post here when resolved

    #22296

    bbrendon
    Participant

    Did you figure this out? I’m using nginx (proxy_pass) for invoice ninja and I have only been able to get it work if I specify an (*) asterisk as TRUSTED_PROXIES.

    I tried specifying a single IP address of nginx but that didn’t work. I also tried CIDR notation, also did not work.

    Does anyone know that TRUSTED_PROXIES actually does?

    #22297

    Hillel Coren
    Keymaster

    TRUSTED_PROXIES accepts a comma delimited list of subnets

    https://invoice-ninja.readthedocs.io/en/latest/configure.html#using-a-reverse-proxy

    #22298

    bbrendon
    Participant

    Yea. I tried exactly
    TRUSTED_PROXIES=’10.0.0.0/8,172.16.0.0/12,192.168.0.0/16′

    which is basically *

    …but they don’t work equally.

    After I put the right IP address it worked. Lol. Not sure where I came up with the IP I tried originally. Brain fart.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

Posted in: