作者:XIE绍雄 | 来源:互联网 | 2017-05-13 02:18
nginx下面几个配置vhost的例子
php
server {
server_name stage.localhost;
listen80 ;
root /data;
indexindex.html index.htm index.php;
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /data$fastcgi_script_name;
include fastcgi_params;
}
}
静态文件
server {
server_name sms.fake;
listen 80;
root /data/fakesms;
index mobile1.html mobile1b.html;
}
其他语言开发的server服务
server {
listen 80;
server_name localhost.pythonserver;
access_log /var/log/nginx/pythonserver-access.log ;
error_log /var/log/nginx/pythonserver-error.log ;
charset utf-8;
client_max_body_size 100m;
client_body_timeout 60;
location /exam0/ {
proxy_pass http://127.0.0.1:8889;
}
location /exam1/ {
proxy_pass http://127.0.0.1:8880;
}
location /exam2/ {
proxy_pass http://127.0.0.1:8881;
}
}
').addClass('pre-numbering').hide();
$(this).addClass('has-numbering').parent().append($numbering);
for (i = 1; i <= lines; i++) {
$numbering.append($('
').text(i));
};
$numbering.fadeIn(1700);
});
});
以上就介绍了nginx配置vhost例子,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。