使用IP和文件夹将虚拟主机添加到nginx

我想testing这个网站,我还没有一个域,并希望能够通过这样的东西访问它:

http://123.123.123.123/testsite

我认为我的testsite.conf文件,我可以这样做:

 server { listen 80; server_name 123.123.123.123/testsite; access_log /var/log/nginx/testsite.com.access.log; access_log /var/log/nginx/testsite.com.error.log; root /var/www/testsite; index index.php; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_pass 127.0.0.1:9000; } } 

但它不起作用…任何人都可以指向正确的方向吗? 谢谢

阅读文档!

server_name指令不得包含URI部分,因为它与HTTP 主机头匹配。

调整你的path和你的位置块匹配/test而不是/