您的位置:首页 > 运维架构 > Nginx

nginx如何配置虚拟主机

2017-07-18 21:35 375 查看
/usr/local/nginx/conf/vhost

 precision.conf  ---  新建文件名称

server
{
listen 80;
#listen [::]:80 default_server ipv6only=on;
server_name local.presion.caomall.net;
index index.html index.htm index.php;
root  /home/wwwroot/default/precision/Public;

#error_page   404   /404.html;
include enable-php-pathinfo.conf;

location /nginx_status
{
stub_status on;
access_log   off;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires      30d;
}

location ~ .*\.(js|css)?$
{
expires      12h;
}

location ~ /\.
{
deny all;
}

access_log  /home/wwwlogs/access.log;
}
http://hiwifi.com/login_web.html?from_index_1500435362437
----极路由---也要配置什么----》

级路由----智能插件----去往插件市场----自定义host---

或者:/etc/hosts   在文件中配置;~~~~~!!!

sudo vim /etc/hosts

注意:linux  1.3的好像用不了require函数,会报错;

服务器重启:

 sudo nginx -s stop

 sudo nginx

---/etc/  host  文件打开处理---~~~~worked~~~

配置PDO---链接数据库:---在mysql命令行操作

grant all on *.* to 用户名@'%' identified by '密码';

flush privileges
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: