我在阿里云服務(wù)器上安裝了nginx,使用PHP的CI框架開(kāi)發(fā),但是配置的nginx的配置文件無(wú)法訪問(wèn)ci框架的其他控制器,只能訪問(wèn)默認(rèn)的welcome控制器。而且也只能訪問(wèn)默認(rèn)控制器的index方法,請(qǐng)問(wèn)我該如何修改?nginx配置文件如下:
2 #user nobody;
3 worker_processes 1;
4
5 #error_log logs/error.log;
6 #error_log logs/error.log notice;
7 #error_log logs/error.log info;
8
9 #pid logs/nginx.pid;
10
11
12 events {
13 worker_connections 1024;
14 }
15
16
17 http {
18 include mime.types;
19 default_type application/octet-stream;
20
21 #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
22 # '$status $body_bytes_sent "$http_referer" '
23 # '"$http_user_agent" "$http_x_forwarded_for"';
24
25 #access_log logs/access.log main;
26
27 sendfile on;
28 #tcp_nopush on;
29
30 #keepalive_timeout 0;
31 keepalive_timeout 65;
32
33 #gzip on;
34
35 server {
36 listen 80;
37 server_name 106.14.119.56;
38 root /var/www/html/myproject;
39 index index.html index.htm index.php;
40
41 #charset koi8-r;
42
43 #access_log logs/host.access.log main;
44
45 location / {
46 try_files $uri $uri/ /index.php?$query_string;
47
48 if (-f $request_filename) {
49 expires 10d;
50 break;
51 }
52
53 if (!-e $request_filename) {
54 rewrite ^/(.*)/$ /index.php/$1 last;
55 }
56 }
57
58 location ~ ^(.+\.php)(.*)$ {
59 fastcgi_index index.php;
60 fastcgi_split_path_info ^(.+\.php)(.*)$;
61 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
62 fastcgi_param PATH_INFO $fastcgi_path_info;
63 fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
64 fastcgi_pass 127.0.0.1:9000;
65 fastcgi_intercept_errors on;
66 include fastcgi_params;
67 }
68
69
70 # redirect server error pages to the static page /50x.html
71 #
72 error_page 500 502 503 504 /50x.html;
73 location = /50x.html {
74 }
75
76 # proxy the PHP scripts to Apache listening on 127.0.0.1:80
77 #
78 #location ~ \.php$ {
79 # proxy_pass http://127.0.0.1;
80 #}
81
82 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
83 #
84 #location ~ \.php$ {
85 # root html;
86 # fastcgi_pass 127.0.0.1:9000;
87 # fastcgi_index index.php;
88 # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
89 # include fastcgi_params;
90 #}
91
92 # deny access to .htaccess files, if Apache's document root
93 # concurs with nginx's one
94 #
95 #location ~ /\.ht {
96 # deny all;
97 #}
98 }
99
100
101 # another virtual host using mix of IP-, name-, and port-based configuration
102 #
103 #server {
104 # listen 8000;
105 # listen somename:8080;
106 # server_name somename alias another.alias;
107
108 # location / {
109 # root html;
110 # index index.html index.htm;
111 # }
112 #}
113
114
115 # HTTPS server
116 #
117 #server {
118 # listen 443 ssl;
119 # server_name localhost;
120
121 # ssl_certificate cert.pem;
122 # ssl_certificate_key cert.key;
123
124 # ssl_session_cache shared:SSL:1m;
125 # ssl_session_timeout 5m;
126
127 # ssl_ciphers HIGH:!aNULL:!MD5;
128 # ssl_prefer_server_ciphers on;
129
130 # location / {
131 # root html;
132 # index index.html index.htm;
133 # }
134 #}
135
136 }
沒(méi)有測(cè)過(guò),你試試看
server {
listen 80;
listen [::]:80 ipv6only=on;
server_name www.example.com;
root /data/www/www.example.com;
index index.php index.html index.htm;
location / {
# 這里使用try_files進(jìn)行url重寫(xiě),不用rewrite了。
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php($|/) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
北大青鳥(niǎo)APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專(zhuān)業(yè)的國(guó)家
北大青鳥(niǎo)中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過(guò)二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開(kāi)發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_(kāi)發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開(kāi)發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開(kāi)發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開(kāi)發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問(wèn),美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。