nginx只提供域的主目录

我已经build立了nginx,并在两个不同的领域(有点)工作。 但由于某种原因,nginx只能提供目录的索引文件,不pipe在地址栏中input什么内容。 例如。 example.com/about只显示example.com

这里是我目前的configuration,如果你们中的任何一个人/女孩都可以帮助我,那将不胜感激,谢谢!

server { listen 80; server_name samayres.net www.samayres.net; index index.html index.php index.htm; access_log /home/sam/www/samayres.net/logs/access_logs.log; error_log /home/sam/www/samayres.net/logs/error_logs.log; root /home/sam/www/samayres.net; error_page 401 401.html; error_page 403 403.html; error_page 404 404.html; error_page 500 502 503 504 500.html; location / { try_files $uri $uri/ /index.php?$args; } # rewrite adminpanel to use https rewrite ^/adminpanel(.*)$ https://$host$uri permanent; # Add trailing slash to */wp-admin requests. Needed if wordpress is installed later rewrite /wp-admin$ $scheme://$host$uri/ permanent; # Directives to send expires headers location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires 30d; } # Deny all attempts to access hidden files such as .htaccess, .htpasswd location ~ /\. { deny all; access_log off; log_not_found off; } location ~ \.php$ { try_files index index.php $uri =404; include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/sam/www/samayres.net/index.php; } } 

nginx.conf是默认的,我没有做任何改变。

这是因为这个fastcgi_param SCRIPT_FILENAME /home/sam/www/samayres.net/index.php;

它应该像fastcgi_param SCRIPT_FILENAME $document_root/php/$fastcgi_script_name;

根据NGINX的文档: http ://wiki.nginx.org/HttpFastcgiModule