We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Path error with Nginx

Hi all, My site works fine on apache server. But on Nginx server encountered a little trouble

visit at: https://ototuanphat.fdola.com/public/plugins/elFinder/elfinder.html Screenhot https://i1092.photobucket.com/albums/i414/thanhansoft/Untitled-1_zpsjzxwoxt4.png

this is my config .conf on Nginx


location / {
    rewrite ^/(.*)$ /public/index.php?_url=/$1;
  }
  location @rewrite {
    rewrite ^/(.*)$ /public/index.php?_url=/$1;
  }

I need access to files elFinder.html, please help me

edited Aug '16

When I open link you provided, it works.

Additionally, for nginx conf it's better to use:

location / {
try_files $uri $uri/ /index.php$is_args$query_string;
}

DO NOT show public dir to the general public, but only www.yourdomain.com/index.php



26.3k
Accepted
answer
edited Aug '16

Hi, thank you support. I've tried your way, but without success. I've used this way, and success


location / {
    rewrite ^/(.*)$ /public/index.php?_url=/$1;
  }
  location @rewrite {
    rewrite ^/(.*)$ /public/index.php?_url=/$1;
  }
  location /public/plugins/elFinder/elfinder.html {
    try_files $uri $uri/ /public/plugins/elFinder/elfinder.html$is_args$query_string;
  }

Thank for so much