这篇文章仅仅是操作,解释说明部分待更新. 1. 修改nginx的配置文件(我的配置文件在/etc/nginx/nginx.conf) [root@xxx ~]# find / -name nginx.conf [root@xxx ~]# vim /etc/nginx/nginx.conf nginx.conf配置文件的大致结构: ... http{ server{ ... #一个server结构可以对应一个域名 } include vhosts/*.conf; #增加这一句,以后所有新增的域名都…
How To Set Nginx Support PATHINFO URL Model And Hide The /index.php/ 就像这样 The URL before setting like this: http://serverName/index.php?m=Home&c=Customer&a=getInformation&id=1 Now like this: http://serverName/Home/Customer/getInformation/id/1…
     nginx绑定多个域名可又把多个域名规则写一个配置文件里,也可又分别建立多个域名配置文件,我一般为了管理方便,每个域名建一个文件,有些同类域名也可又写在一个总的配置文件里. 一.每个域名一个文件的写法 首先打开nginx域名配置文件存放目录:/usr/local/nginx/conf/servers ,如要绑定域名www.web126.com 则在此目录建一个文件:www.web126.com.conf 然后在此文件中写规则,如: server { listen       80; s…
as今天准备把网站搬迁到nginx上发现codeigniter框架在nginx上不能使用,后来发现是nginx不支持pathinfo,下面介绍怎么在nginx下开启pathinfo 开始pathinfo支持 location ~ \.php{ fastcgi_pass ; fastcgi_index index.php; ##########################################pathinfo 模式 set $path_info ""; set $real_…
server { listen 80; server_name zuqiu.com; # 设置你的域名 index index.html index.htm index.php; root D:/wnmp/www/dev/zuqiu; # 设置你的程序路径 location ~ \.php { root D:/wnmp/www/dev/zuqiu; # 设置你的程序路径 fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_p…
1.apache2的配置 首先要配置好apache2,如果未配置,请参考我之前的博文:lamp的配置 2.域名的解析 将全部域名的www和@的A记录解析到云服务器的IP 3.虚拟主机的配置 1.配置httpd.conf 如果etc/httpd/conf/httpd.conf存在,则配置此httpd.conf 如果etc/httpd/conf/httpd.conf不存在,此时需要我们在/etc/apache2下新建一个httpd.conf,配置此httpd.conf,然后 /etc/apache2…
<VirtualHost *:80> DocumentRoot "E:\web\bubuchu" ServerName bubuchu.com ServerAlias *.bubuchu.com </VirtualHost>…
编辑如下区段: location ~ [^/]\.php(/|$) { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; } 第1行改为: location ~ [^/]\.php 第4行注释…
[ Apache ] 将httpd.conf配置文件中mod_rewrite.so所在行前面的‘#’去掉 AllowOverride None 将None改为 All 效果图…
server { listen ; server_name www.domain.com domain.com; error_page /.html; error_page /50x.html; location ~ \.php { root /data0/htdocs/www; fastcgi_pass ; #包含nginx服务器传递给fastcgi程序的参数,php中通过$_SERVER['参数名']可获取 include fastcgi.conf; #定义变量$fastcgi_script…