Skip to content

Cannot set both location_alias and fastcgi at the same time on a location #591

@alex-barylski

Description

@alex-barylski

I have the following:

  nginx::resource::vhost { 'aerospace':
    ensure                => present,

    www_root              => '/usr/share/nginx/html',
    server_name           => ['apps.cadorath.local'],

    index_files           => ['index.php', 'index.html'],

    fastcgi     => 'unix:/var/run/php5-fpm.sock',
  }

  nginx::resource::location { 'application':
    vhost => 'aerospace',

    ensure  => present,
    location => '~ [^/]\.php(/|$)',
    location_alias => '/usr/share/nginx/html/application',

    fastcgi_split_path => '^(.+>\.php)(/.*)$',
    fastcgi_param  => {
      'MYDOMAIN_FQDN' => 'http://apps.mydomain.local',
    }
  } 

This is the resulting file in .../sites-enabled

server {
  listen *:80;
  server_name           apps.cadorath.local;

  set $maintenance "off";
  if ($maintenance = "on") {
      return 503;
  }
  index  index.php index.html;

  access_log            /var/log/nginx/aerospace.access.log combined;
  error_log             /var/log/nginx/aerospace.error.log;

  location ~ [^/]\.php(/|$) {
    alias /usr/share/nginx/html/application;
  }

  location / {
    root          /usr/share/nginx/html;
    include       /etc/nginx/fastcgi_params;

    fastcgi_pass  unix:/var/run/php5-fpm.sock;
  }
}

Why is split_path and param not being echo'ed to the resulting file -- no errors as far as I can tell. What am I missing???

Alex

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions