I am trying to open the location of my index.php file for example: The root folder is: /path/to/my/root/folder Code (markup): The the url a user will use to get to this root folder is: https://sub.mydomain.net/server/client Code (markup): Every time I use this location declaration I get a 404 or forbidden message location /server/client/ { alias /path/to/my/root/folder; try_files $uri $uri/ /index.php$uri$is_args$args; } Code (markup): I just cannot work out what I am doing wrong. Of course the index.php is located here: /path/to/my/root/folder/index.php Code (markup): Just for clarification I have declared the following also: index index.html index.php; location ~ \.php$ { include conf.d/services/php7.conf; } Code (markup): Like I said I just cannot work out what is wrong?
If you want nginx to serve the index.php file only, you can try with the following configuration: location /server/client/ { alias /path/to/my/root/folder/index.php; } Code (markup): If you are still getting an error message, check the error log for more details.