1
ivmm 2015-08-16 16:58:07 +08:00 1
是404
|
3
Mizzi 2015-08-16 17:24:11 +08:00 1
用 orvice 的啊
|
4
smileawei 2015-08-16 18:15:47 +08:00 via iPhone 1
后端用apache吧。
|
6
Mizzi 2015-08-16 20:33:51 +08:00 1
|
7
ksupertu 2015-09-01 03:40:07 +08:00 1
刚踩了一下坑,研究了下这个 moess 配置 nginx 的关键在于开启 nginx 的 pathinfo 支持,不然的话弹一堆 404 ,需要注意的地方是:
1 、添加重定向 ``` location / { if (!-e $request_filename ) { rewrite ^/(.*)$ /index.php/$1 last; break; } } ``` 2 、 fastcgi 配置 ``` location ~ \.php { try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fcgi_pathinfo.conf; include fastcgi_params; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php )(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } ``` 注意此处的\.php 后面的$符号要删去,切记如此 3 、 fcgi_pathinfo.conf 的内容 ``` #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #fastcgi_param SCRIPT_NAME $fastcgi_script_name; #这两行是需要注释掉的,请注意 fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param HTTPS $https if_not_empty; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; # PHP only, required if PHP was built with --enable-force-cgi-redirect fastcgi_param REDIRECT_STATUS 200; ``` 然后 nginx -t 测试一下, nginx -s reload 重新读取配置文件后大功告成,写在这里给以后踩坑的同学们看一下 |