- 积分
- 119
- 威望
-
- 金钱
-
- 注册时间
- 2010-7-12
- 在线时间
- 小时
- 最后登录
- 1970-1-1
|
nginx下添加域名是不是有两种方式
1 直接运行 ./vhost.sh
2- 修改/usr/local/nginx/conf/nginx.conf 文件
- 在
- server
- {
- listen 80;
- server_name status.lnmp.org;
- location / {
- stub_status on;
- access_log off;
- }
- }
- 后面添加上下面代码:
- server
- {
- listen 80;
- server_name www.abc.com
- ;
- index index.html index.htm index.php;
- root /home/wwwroot/abc;
- location ~ .*\.(php|php5)?$
- {
- fastcgi_pass unix:/tmp/php-cgi.sock;
- #fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- include fcgi.conf;
- }
- location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
- {
- expires 30d;
- }
- location ~ .*\.(js|css)?$
- {
- expires 12h;
- }
- access_log off;
- }
- 再执行kill -HUP `cat /usr/local/nginx/logs/nginx.pid`虚拟机就生效了。
复制代码 我用./vhost.sh 添加 了一个域名 和目录后 显示

不知道这样的目录正确不正确.
然后在***.com 里放了一个网页文件 ,访问 显示 403 Forbidden.
有熟练nginx的朋友麻烦讲解一下, 添加多网站目录,多域名的步骤. |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|