dingo / api

A RESTful API package for the Laravel and Lumen frameworks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nginx proxy apache, no https

ztj1993 opened this issue · comments

commented
Q A
Bug? yes
New Feature? no
Framework Laravel
Framework version 7.x
Package version 3.0.0
PHP version 7.x

Actual Behaviour

ngxin proxy apache, Domain name: https://test.com , model () - > paginate (10); the generated domain name is wrong, there is no HTTPS.

I found some solutions, but most of them couldn't solve the problem.

{
    "current_page": 1,
    "data": [],
    "first_page_url": "http://test.com/?page=1"
}

Expected Behaviour

Expected generation:

{
    "current_page": 1,
    "data": [],
    "first_page_url": "https://test.com/?page=1"
}

Steps to Reproduce

nginx proxy apache
nginx setting https


The above is from software translation.

you could try using

\URL::forceScheme('https');
commented

@iBet7o https://laravel.com/docs/7.x/requests#configuring-trusted-proxies

thank you! This should be the most effective method. I have already practiced it.