# Virtual server configuration

**URL:** <https://www.ruby-forum.com/t/virtual-server-configuration/245560>\
**Category:** NGINX\
**Created:** [June 17, 2013, 4:37pm UTC](https://www.ruby-forum.com/t/virtual-server-configuration/245560 "2013-06-17T16:37:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [June 17, 2013, 4:37pm UTC](https://www.ruby-forum.com/t/virtual-server-configuration/245560/1 "2013-06-17T16:37:15Z")

</div>

Hi

I’m new to nginx. I’m trying to configure a virtual server.

I’ve created a new server file under sites-enabled like this:

server {  
listen 80; ## listen for ipv4; this line is default and implied

```
server_name blogtest;

root /usr/share/nginx/cakephptest/app/webroot;
index index.php;

location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to 404
        try_files $uri $uri/ =404;
}
# PHP FPM
location ~ \.php$ {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_intercept_errors on;
        fastcgi_buffers 8 16k;
        fastcgi_buffer_size 32k;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param PATH_TRANSLATED 

```

$document\_root$fastcgi\_path\_info;  
fastcgi\_param SCRIPT\_FILENAME  
$document\_root$fastcgi\_script\_name;  
}  
}

Is there anything wrong with that?  
When I type in blogtest/index.php on the browser I get the default  
config,  
which points to /usr/share/nginx/www/, even though I deleted the  
symbolic  
link to sites-available/default from sites-enabled.

Note: /usr/share/nginx/cakephptest/app/webroot/index.php does exist.

Could anyone please help.

Thanks

JV

–  
[image: WiFi SPARK]  
[image: Facebook] [http://facebook.com/wifispark](http://facebook.com/wifispark) [image:  
Twitter][http://twitter.com/wifispark](http://twitter.com/wifispark)  
_Janet Valbuena_  
Software Developer  
_t:_ 0844 848 9555 | \*f: \*01626 834 745  
\*w: \*[wifispark.com](http://wifispark.com) [http://www.wifispark.com/](http://www.wifispark.com/)

WiFi SPARK Ltd, Teignbridge Business Centre, Cavalier Road, Newton  
Abbot,  
Devon, TQ12 6TZ

This message and its attachments are deemed confidential. If you are not  
the intended recipient, you are strictly prohibited to disclose, copy,  
distribute or take any action in relation to the contents of this  
message.  
WiFi SPARK accepts no liability for virus transmission, for the content  
of  
this email, or for the consequences of any actions taken on the basis of  
the information provided, unless that information is subsequently  
confirmed  
in writing.

---

<div class="post-metadata">

**Author:** ![Janet\_Valbuena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19adc/32.png) [@Janet\_Valbuena](https://www.ruby-forum.com/u/Janet_Valbuena)\
**Post date:** [June 17, 2013, 4:48pm UTC](https://www.ruby-forum.com/t/virtual-server-configuration/245560/2 "2013-06-17T16:48:56Z")

</div>

* * *

nginx mailing list  
removed\_email\_address@domain.invalid  
[http://mailman.nginx.org/mailman/listinfo/nginx](http://mailman.nginx.org/mailman/listinfo/nginx)

---

<div class="post-metadata">

**Author:** ![Janet\_Valbuena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19adc/32.png) [@Janet\_Valbuena](https://www.ruby-forum.com/u/Janet_Valbuena)\
**Post date:** [June 17, 2013, 4:54pm UTC](https://www.ruby-forum.com/t/virtual-server-configuration/245560/3 "2013-06-17T16:54:13Z")

</div>

Hi Sajan

Yes I did restart nginx. I’ve tried several times.

Just tried nginx -t and all seems to be fine.

nginx -t  
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok  
nginx: configuration file /etc/nginx/nginx.conf test is successful

JV

On 17 June 2013 15:48, Sajan P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> [image: Noppix LLC Logo]
> 
> ```
> # PHP FPM
> fastcgi_param SCRIPT_FILENAME
> 
> ```
> 
> Note: /usr/share/nginx/cakephptest/app/webroot/index.php does exist.  
> [image: WiFi SPARK]  
> the intended recipient, you are strictly prohibited to disclose, copy,
> 
> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)

–  
[image: WiFi SPARK]  
[image: Facebook] [http://facebook.com/wifispark](http://facebook.com/wifispark) [image:  
Twitter][http://twitter.com/wifispark](http://twitter.com/wifispark)  
_Janet Valbuena_  
Software Developer  
_t:_ 0844 848 9555 | \*f: \*01626 834 745  
\*w: \*[wifispark.com](http://wifispark.com) [http://www.wifispark.com/](http://www.wifispark.com/)

WiFi SPARK Ltd, Teignbridge Business Centre, Cavalier Road, Newton  
Abbot,  
Devon, TQ12 6TZ

This message and its attachments are deemed confidential. If you are not  
the intended recipient, you are strictly prohibited to disclose, copy,  
distribute or take any action in relation to the contents of this  
message.  
WiFi SPARK accepts no liability for virus transmission, for the content  
of  
this email, or for the consequences of any actions taken on the basis of  
the information provided, unless that information is subsequently  
confirmed  
in writing.
