nginx配置:接口开放

(还没明白为啥在wecenter中就可以写接口了,后面会补充)
在配置中插入如下代码:

if (!-e $request_filename)
             {
                   rewrite (.*) /index.php;
              }

整体代码如下:

server {
    listen       80;
    server_name  smarticle.club;
	root   /www/www;
    location / {
        
        index  index.html index.htm index.php;
		
		if (!-e $request_filename)
             {
                   rewrite (.*) /index.php;
              }
            #autoindex  on;
    }


    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
       root   /usr/share/nginx/html;
    }

	location ~ \.php$ { root /www/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
}

你可能感兴趣的:(nginx配置:接口开放)