Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NGINX_INDEX_FILE doesn't work from v5.1.0 and above #41

Closed
walkero-gr opened this issue Nov 29, 2019 · 1 comment
Closed

NGINX_INDEX_FILE doesn't work from v5.1.0 and above #41

walkero-gr opened this issue Nov 29, 2019 · 1 comment

Comments

@walkero-gr
Copy link

Hello all.
Using the nginx 1.5-5.0.18 I can set the default index file other than index.php with the environment variable NGINX_INDEX_FILE, with NGINX_VHOST_PRESET: php

Unfortunately if I try to use any other version from 1.15-5.1.0 and above this doesn't work. Of 'course none of the available versions of 1.17 works as well.

Then change that happened at the php preset is at line 5 where
{{ $index := (getenv "NGINX_INDEX_FILE" "index.php") }}
cahnged to
{{ $index := (getenv "NGINX_FASTCGI_INDEX" "index.php") }}

As a result of the above is to have a different file mentioned at the produced preset.conf file inside /etc/nginx, where on every version from 5.1.0 there is the following line
try_files $uri /index.php?$args;
instead of
try_files $uri /front.php?$args;
For the above I set the NGINX_INDEX_FILE: front.php

Of 'course if I set both ENV variables the same file, it works just fine. i.e.
NGINX_INDEX_FILE: 'front.php'
NGINX_FASTCGI_INDEX: 'front.php'

Is this intentional or a mistake? I am asking because the documentation doesn't mention it anywhere.

@csandanov
Copy link
Member

The separation on two env vars was done intentionally because multiple files can be provided for the vhost index unlike fastcgi index, see #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants