1 server {
2 listen 80;
3 server_name www.abc.com;
4 root /www/tianyi;
5 index index.html index.htm index.php;
6 #charset koi8-r;
7 #access_log /var/log/nginx/host.access.log main;
8
9 location / {
10
11 if (!-e $request_filename) {
12
13 rewrite ^(.*)$ /index.php?s=$1 last; break;
14
15 }
16
17 }
18
19
20 #error_page 404 /404.html;
21
22 # redirect server error pages to the static page /50x.html
23 #
24 error_page 500 502 503 504 /50x.html;
25 location = /50x.html {
26 root /usr/share/nginx/html;
27 }
28
29 # proxy the PHP scripts to Apache listening on 127.0.0.1:80
30 #
31 #location ~ \.php$ {
32 # proxy_pass http://127.0.0.1;
33 #}
34
35 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
36 #
37 location ~ \.php$ {
38 root /www/tianyi;
39 fastcgi_pass 127.0.0.1:9000;
40 fastcgi_index index.php;
41 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
42 include fastcgi_params;
43 }
44
45 # deny access to .htaccess files, if Apache's document root
46 # concurs with nginx's one
47 #
48 #location ~ /\.ht {
49 # deny all;
50 #}
51 }
52 server {
53 server_name abc.com;
54 rewrite ^(.*)$ http://www.abc.com$1 permanent;
55 }
目前只有首页可以访问访问带URL参数页面 提示参数无法访问 $_GET['cid'] 打印cid值为空
http://www.abc.com/content/lists/cid/3.html
最佳答案
