kasperisager / php-dockerized

Dockerized PHP development stack: Nginx, MySQL, MongoDB, PHP-FPM, HHVM, Memcached, Redis, Elasticsearch and RabbitMQ

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with symlinks in www folder

maximelebastard opened this issue · comments

Hi,

I've got php dockerized on the /home/maxime/workspace/Webserver location.

I've also got a project on the /home/maxime/workspace/web/johndoeproject location. I made a symlink of this in the /home/maxime/workspace/Webserver/www/johndoeproject location.

I created a vhost for this:

server {
  server_name johndoe.dev;
  root /var/www/johndoeproject;
  index       index.html index.htm index.php;

  # client_max_body_size 100M;
  # fastcgi_read_timeout 1800;

  location / {
#    try_files $uri $uri/ /index.php;
    disable_symlinks off;
  }

  location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
#    expires       max;
    log_not_found off;
    access_log    off;
  }

  location ~ \.php$ {
    try_files     $uri =404;
    include       fastcgi_params;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_pass  unix:/var/run/php5-fpm.sock;
    # fastcgi_pass  unix:/var/run/hhvm/hhvm.sock;
  }
}

This vhost works when I hard copy the project, but not when I make a symlink. My host is under Linux Mint 17.2 .

Did I forget an option to work with symlinks ? The Internet only says something for the disable_symlinks off flag.

The target that you're symlinking needs to be available within the container, i.e. somewhere within the www folder.

Ok, I understand the problem ! It seems obvious now... Thanks a lot !