I move my Friendly URL's from Apache to nginx and I have a problem. I want to Friendly URL's only works within the subdirectory **sgforum**.

In PHP, I receive the addresses as: ***127.0.0.1/sgforum/index***, ***127.0.0.1/sgforum/member*** etc.

When I go on *127.0.0.1/sgforum/* - it works, but when I give **member** (***127.0.0.1/sgforum/member***), or **index**, it downloads a file to my computer, instead of opening with php.

This is my ***/etc/nginx/sites-available/default*** file:

```
server {
    listen 80 default_server;
    #listen [::]:80 default_server;

    root /home/ariel/workspace;

    index index.php index.html;

    server_name _;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    # FRIENDLY URLS
    location /sgforum/ {
        if (!-e $request_filename){
            rewrite ^/sgforum/(.*)$ /sgforum/index.php break;
        }
    }

    location ~ /\.ht {
        deny all;
    }
}

```