请问我该如何修改nginx配置文件才可以访问CI框架?nginx配置详情见提问内容

消弭的小米 2018-01-20 10:26:50
运行环境:centos 7 。现在的情况是我的只可以访问默认控制器下的默认index方法,其他的一概访问不了,请问下我该如何修改呢?配置文件内容如下:


```
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 }
```
...全文
1002 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

4,251

社区成员

发帖
与我相关
我的任务
社区描述
国内外优秀PHP框架讨论学习
社区管理员
  • Framework
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧