i developed an api on symfony4 and I manage my tokens with LexikJWTAuthenticationBundle.
In localhost everything works fine but on my test server (ubuntu mate on raspbery pi,apache, https) the server sends me a 401 error and Invalid JWT Token.
As stated on the readme (https://github.com/lexik/LexikJWTAuthenticationBundle/blob/master/Resources/doc/index.md#generate-the-ssh-keys) I tried to add
SetEnvIf Authorization "(. *)" HTTP_AUTHORIZATION = $ 1
to configure my virtualhost and restart apache but that does not change anything.
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/current/rest_api/public
<Directory /var/www/html/current/rest_api/public>
# enable the .htaccess rewrites
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerName mydomain
SSLCertificateFile /etc/letsencrypt/live/mydomain/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mydomain/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
</VirtualHost>
</IfModule>
Thanks for your help
Problem solved by generating private.pem with:
instead of
solved solution by: https://github.com/attineos/tutotrompe/tree/master/tutotrompe-ep2