Docker-nginx: Perl module not enabled with alpine Dockerfile?

Created on 24 Sep 2016  路  6Comments  路  Source: nginxinc/docker-nginx

I am using nginx:alpine and trying to set my environment variables with:

perl_set $SOME_KEY 'sub { return $ENV{"SOME_KEY"}; }';

in my nginx.conf file. As far as I know (from the Dockerfile) alpine version comes with --with-http_perl_module, but I am getting nginx: [emerg] unknown directive "perl_set" in /etc/nginx/nginx.conf:36. What am I doing wrong?

Most helpful comment

Loading the module with command nginx -g 'daemon off; load_module /etc/nginx/modules/ngx_http_perl_module-debug.so;' resolved the issue.

All 6 comments

Loading the module with command nginx -g 'daemon off; load_module /etc/nginx/modules/ngx_http_perl_module-debug.so;' resolved the issue.

Cool, that's what i'm searched. Its would be cool if this tip was present in docker hub nginx main page. Thanks!

using centos and nginx repo, install package nginx-module-perl and load the module

Loading the module with command nginx -g 'daemon off; load_module /etc/nginx/modules/ngx_http_perl_module-debug.so;' resolved the issue.

Thanks! You made my day.
After hours of searching, I got a Docker container with Nginx and nginx-module-perl.

@eleftrik Hi, you can also use nginx:alpine-perl image, and use the load_module directive in your nginx.conf file, instead of re-defining the CMD.

@eleftrik Hi, you can also use nginx:alpine-perl image, and use the load_module directive in your nginx.conf file, instead of re-defining the CMD.

Thanks for your feedback. During my attempts, I tried different solutions and each one gave me a different error. Redefining the CMD was the only one that worked for me, but maybe I did some mistakes while trying to find a solution.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

colinmollenhour picture colinmollenhour  路  6Comments

eigood picture eigood  路  5Comments

HeyRobb picture HeyRobb  路  5Comments

sandersaares picture sandersaares  路  6Comments

ralphsmith80 picture ralphsmith80  路  5Comments