V
V
Viktor Yanyshev2019-01-09 18:26:07
Nginx
Viktor Yanyshev, 2019-01-09 18:26:07

Directory symlink matches URL, why is it giving 403 on URL?

There is a URL domain.com/catalog and a symlink /var/www/html/catalog . When going to the domain.com/catalog URL , NGINX throws 403, it is clear that it is knocking on the /var/www/html/catalog directory instead of /var/www/html/index.php . Symlink 2 directories ./catalog/images and ./catalog/files .
How can I make it so that the url ./catalog/[images|files] pulls the necessary files from the directory, and if images or files are not in the url, nginx knocks on /var/www/html/index.php

nginx config:
server {
   charset utf-8;
   client_max_body_size 128M;
   sendfile off;

   listen 8080; 

   server_name pr.local;
   root        /var/www/html;
   index       index.php;

   access_log  /var/log/nginx/log/pr.access.log;
   error_log   /var/log/nginx/log/pr.error.log;

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

   location ~ \.(js|map|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
       try_files $uri =404;
   }
   error_page 404 /404.html;

   location ~ \.php$ {
       include fastcgi_params;
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       fastcgi_pass   127.0.0.1:9072;

       try_files $uri =404;
   }

   location ~ /\.(ht|svn|git) {
       deny all;
   }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-01-09
@villiwalla

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

Just remove $uri/
location / {
     try_files $uri /index.php$is_args$args;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question