kiddkyd
楼主 你好 不知道你用nginx怎么配置restful api的虚拟域名访问的? 我配置如下,但是一直报404错误,困扰我很久了
server {charset utf-8; client_max_body_size 128M; set $fcgi_server 127.0.0.1:9000; listen 80; ## listen for ipv4 server_name api.denghp.com; root /home/denghp/webroot/yii2-advanced-api/api/web; index index.php; access_log /usr/local/nginx/logs/yii2_demo_api_access.log main; error_log /usr/local/nginx/logs/yii2_demo_api_error.log; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_pass $fcgi_server; } location ~ /\.(ht|svn|git) { deny all; }
}
访问地址,都试过
http://api.denghp.com/v1/countries
http://api.denghp.com/v1/country可以试试upupw
- kiddkyd 2015-08-10 已签到连续签到2天,获得了10个金钱
- kiddkyd 2015-08-09 已签到连续签到1天,获得了5个金钱