I want to configure nginx so that all requests that start from the "/ usa" folder lead to a specific index.php.
What you need: I want to place the site in a folder of another site so that one site can be accessed at site.com/usa , and another site site.com be accessed at site.com . Both sites should accept all requests to their index.php.
When I address on url site.com/usa/test , returns the 404th error that there is no such urla. In principle, it is logical, since it should be redirected to site.com/usa/ , but I do not know how to do it.
Config file contents:
server { listen 80; listen [::]:80; root /var/www/site.com; index index.php index.html index.htm; server_name site.com; charset utf-8; location ~* ^.+\.(rss|atom|jpg|jpeg|gif|png|ico|rtf|js|css|woff|otf|eot|fft)$ { expires max; } location / { rewrite ^([^.]*[^/])$ $1/ permanent; try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } }