Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-25900

Nginx vhost.template not working because of IF statement

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: High High
    • QA tracked issues
    • 16.02
    • Install, Misc
    • None

    Description

      Please check the vhost.template for Nginx, lines 36-40:

      # Environment.
      # Possible values: "prod" and "dev" out-of-the-box, other values possible with proper configuration
      # Make sure to comment the "ez_params.d/ez_prod_rewrite_params" include above in dev.
      # Defaults to "prod" if omitted
      #if[SYMFONY_ENV] fastcgi_param SYMFONY_ENV %SYMFONY_ENV%;

      Uncomment the last line and set it to dev.

      if[SYMFONY_ENV] fastcgi_param SYMFONY_ENV dev;

      Test Nginx configuration.

      nginx -t

      You will see the following error:
      2016/06/17 13:14:48 [emerg] 16933#0: unknown directive "if[SYMFONY_ENV]" in /etc/nginx/eZ/sites/ezpublish.enabled:33
      nginx: configuration file /etc/nginx/nginx.conf test failed

      I am using:

      nginx version: nginx/1.4.6 (Ubuntu)

      Just as a reminder, Nginx does not recommend the usage of IFs and I am not sure if it makes sense to use it in official vhost templates. Please check If Is Evil article on the oficial Nginx website.

      Also, environment variables are not recommended. Please check:

      Attachments

        Activity

          People

            Unassigned Unassigned
            eduardo.fernandes-obsolete@ez.no Eduardo Fernandes (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: