我们现在使用nginx的几种方式

我们现在使用nginx的几种方式:
cgi模式:
php:
<pre class="prettyprint"  lang="javascript">
server {
        listen       80 ;
        server_name  www.uwetech.com;
index index.php index.html index.htm;  
location / {
            root e:/uwetech/php/www/wordpress2/;
            index  index.html index.htm index.php;
        }  
location ~ \.php$ {
 root e:/uwetech/php/www/wordpress2/;
 fastcgi_pass   127.0.0.1:9124;
 fastcgi_index  index.php;
 fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
 include        fastcgi_params;
}
}
</pre> 
python:
<pre class="prettyprint"  lang="javascript">
server {
       listen       80 ;
       server_name       callcenter.uwetech.com;
location / {
                #include uwsgi_params;
                #uwsgi_pass 127.0.0.1:8000;
fastcgi_split_path_info ^()(.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;  # [1]
fastcgi_param PATH_INFO $fastcgi_script_name;        # [2]
fastcgi_pass 127.0.0.1:3000;
}
}
</pre> 
静态目录方式:
<pre class="prettyprint"  lang="javascript">
server {
        listen       80 ;
        server_name  web.uwetech.com;
root E:/uwetech/web/;
        location / {
            root E:/uwetech/web/;
            index  index.html index.htm;
        }
}
</pre> 
这种最简单,只需要设置root目录。
proxy模式:
<pre class="prettyprint"  lang="javascript">
server {
        listen       80 ;
        server_name  oe.uwetech.com;
location / {
 proxy_pass   http://127.0.0.1:8069;
 proxy_set_header  X-Real-IP  $remote_addr;
}
}
</pre>
这种方式也是比较简单的方式,像那种不提供cgi方式的web软件,可以用这种方式,相当于转发http

你可能感兴趣的:(nginx,PHP,python,cgi)