location PHP配置应该这样: location ~ \.php$ 另外重写的话,可以这样写: server { listen 80; server_name example.com; index index.php index.html; root /code/netapi/public; location / { try_files $uri /index.php$is_args$args; } } root /code/netapi/public;可以写在server段里,因为你重写了后root也没变 PS:请填写代码,不要贴截图
location PHP配置应该这样:
另外重写的话,可以这样写:
root /code/netapi/public;
可以写在server段里,因为你重写了后root也没变PS:请填写代码,不要贴截图