我在阿里云服務(wù)器上安裝了nginx,使用PHP的CI框架開發(fā),但是配置的nginx的配置文件無法訪問ci框架的其他控制器,只能訪問默認(rèn)的welcome控制器。而且也只能訪問默認(rèn)控制器的index方法,請問我該如何修改?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 }
沒有測過,你試試看
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進行url重寫,不用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;
}
}北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
達內(nèi)教育集團成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
北大課工場是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國家深化產(chǎn)教融合/校企合作的政策,積極推進“中國制造2025”,實現(xiàn)中華民族偉大復(fù)興的升級產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負責(zé)iOS教學(xué)及管理工作。
浪潮集團項目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗,技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點難點突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。