在docker-nginx-php服务器上运行2个站点

我正在使用Docker并使用nginx和mysql来提供PHP API服务器。 现在我试图添加一个分离的静态网站,但没有通过修改nginx.conf来做到这一点。 以下是我的文件夹结构。

+ images |+ php |-- Dockerfile ||+ app ||-+ public |||-- index.php ||+ home <-- TRYING TO GET THIS WORKING (Same level as app folder) ||-- index.html <-- TRYING TO THIS WORKING |+ nginx |-- nginx.conf |-- Dockerfile - README.md - docker-compose.yml 

这是我的nginx conf。

 server { listen 80; server_name api.example.com; root /app/public; index index.php index.htm index.html; location / { try_files $uri $uri/ /index.php?$query_string; } location /index.php { include fastcgi_params; fastcgi_connect_timeout 10s; fastcgi_read_timeout 10s; fastcgi_buffers 256 4k; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass php:9000; } add_header Access-Control-Allow-Origin "*"; add_header Access-Control-Allow-Methods "GET, OPTIONS"; add_header Access-Control-Allow-Headers "origin, authorization, accept"; } server { listen 80; server_name example.com www.example.com; root /home; index index.htm index.html location / { try_files $uri $uri/ /index.html; } } 

我可以访问api.example.com,一切正常。 但是当我去到example.com,它显示404没有find。 nginx / 1.114 (与docker-compose.yml有什么关系?)

谢谢!