%ENV different when run via plackup
Hi, I just discovered that %ENV is different (has fewer keys) when I run the application via "plackup ..... app.pl" than when I run it as "./app.pl". My problem is: I want the environment variable HTTP_X_FORWARDED_PROTOCOL defined (= 'https"). I have added the line $ENV{HTTP_X_FORWARDED_PROTOCOL} = 'https'; which works (the key is found in %ENV) when I run "./app.pl" but does not work (no such key) when I run the application as "plackup ..... app.pl" Where do I define the environment variable so that it is set no matter how the application is run Thank you!
Where do I define the environment variable so that it is set no matter how the application is run
Learn to work with your shell. I assume you have bash. # for this command only HTTP_X_FORWARDED_PROTOCOL=https plackup … # for all further commands in this session export HTTP_X_FORWARDED_PROTOCOL=https plackup … For production purposes, edit `/etc/profile.local` or `/etc/profile.d/plackup.sh`. Also see: env(1)
participants (2)
-
Gurunandan Bhat -
Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯