Apache is stripping Authorization headers from Passport


  • | 253 points

    I was about to throw Laravel passport out the windows because I couldn't get it to work.

    And then I finally found out why: Apache isn't properly passing Authorization headers to laravel.

    When I deploy my app to Forge, which uses Nginx as the webserver, it works perfectly. While a good solution would be to use Nginx instead of apache, I am wondering if there are any configuration changes that could be made in Laragon to make sure that the headers are passed properly.

    This is what the current conf looks like but I still can't get it to work.

    any advice?

    <VirtualHost *:80>
    DocumentRoot "C:/Users/Andrew's/Documents/Projects/ApSpark/public/"
    ServerName ApSpark.dev
    ServerAlias .ApSpark.dev
    RewriteEngine On
    RewriteCond %{HTTP:Authorization} .+
    RewriteRule .
    - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    <Directory "C:/Users/Andrew's/Documents/Projects/ApSpark/public/">
    AllowOverride All
    Require all granted
    CGIPassAuth On
    </Directory>
    </VirtualHost>


  • administrators
    | 56177 points

    @aseipp: I will look into the issue.
    No worry, I will release new version of Laragon with managed Nginx support, stay tuned.


  • administrators
    | 56177 points

    @aseipp : Laragon 2.1.0 with Nginx has been released. Hope it helps:
    https://forum.laragon.org/topic/239/laragon-2-1-0-released-with-nginx-support


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.