NGINX Document Location
- by GLaDOS
I want to be able to access a given url, example.com/str. The problem is that the php file that I want to connect to is in a directory of /str/public/. In my nginx logs, I see that it is trying to connect to /str/public/str/index.php. Is there any way to remove that last 'str' in the document request?
Below is my location directive in sites-available/default:
location /str {
root /usr/share/nginx/html/str/public/;
index index.php index.html index.htm;
location ~ ^/str/(.+\.php)$ {
try_files $uri = 404;
root /usr/share/nginx/html/str/public/;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Thank you all so much in advance.