日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Nginx >内容正文

Nginx

12.6 Nginx安装 12.7 默认虚拟主机 12.8 Nginx用户认证 12.9 Nginx

發布時間:2025/3/21 Nginx 55 豆豆
生活随笔 收集整理的這篇文章主要介紹了 12.6 Nginx安装 12.7 默认虚拟主机 12.8 Nginx用户认证 12.9 Nginx 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

12.6 Nginx安裝

[root@martin001 conf]# chkconfig --add nginx
[root@martin001 conf]# chkconfig nginx on
[root@martin001 conf]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@martin001 conf]# /etc/init.d/nginx start
-bash: /etc/init.d/nginx: 權限不夠
[root@martin001 conf]# chmod 755 /etc/init.d/nginx
[root@martin001 conf]# /etc/init.d/nginx start
Reloading systemd: [ 確定 ]
Starting nginx (via systemctl): [ 確定 ]
[root@martin001 conf]# netstat -lntp |grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0: LISTEN 3729/nginx: master
[root@martin001 conf]# ps -aux |grep nginx
root 3729 0.0 0.0 20496 628 ? Ss 23:23 0:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
nobody 3730 0.0 0.3 22940 3200 ? S 23:23 0:00 nginx: worker process
nobody 3731 0.0 0.3 22940 3200 ? S 23:23 0:00 nginx: worker process
root 3736 0.0 0.0 112676 956 pts/0 R+ 23:29 0:00 grep --color=auto nginx
[root@martin001 html]# curl localhost/1.php
this is nginx page test.[root@martin001 html]#

12.7 默認虛擬主機

[root@martin001 vhost]# mkdir /data/wwwroot/default
[root@martin001 vhost]# ls !$
ls /data/wwwroot/default
[root@martin001 vhost]# vim /data/wwwroot/default/index.html
[root@martin001 vhost]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@martin001 vhost]# /usr/local/nginx/sbin/nginx -s reload
[root@martin001 vhost]# !curl
curl -x127.0.0.1:80 aaa.com
This is the default site.

12.8 Nginx用戶認證

[root@martin001 vhost]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@martin001 vhost]# /usr/local/nginx/sbin/nginx -s reload
[root@martin001 vhost]# mkdir /data/wwwroot/test.com
[root@martin001 vhost]# echo "test.com" > /data/wwwroot/test.com/index.html
[root@martin001 vhost]# curl -I -x127.0.0.1:80 test.com
HTTP/1.1 401 Unauthorized
Server: nginx/1.12.1
Date: Tue, 13 Mar 2018 16:21:36 GMT
Content-Type: text/html
Content-Length: 195
Connection: keep-alive
WWW-Authenticate: Basic realm="Auth"
[root@martin001 vhost]# curl -umartin:123456 -x127.0.0.1:80 test.com
test.com

12.9 Nginx域名重定向

[root@martin001 vhost]# vim test.com.conf
[root@martin001 vhost]# cat test.com.conf
server
{
listen 80;
server_name test.com test1.com test2.com;
index index.html index.htm index.php;
root /data/wwwroot/test.com;
if ($host != 'test.com' ) {
rewrite ^/(.*)$ http://test.com/$1 permanent;
}

}

[root@martin001 vhost]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@martin001 vhost]# /usr/local/nginx/sbin/nginx -s reload
[root@martin001 vhost]# curl -x127.0.0.1:80 test1.com/123.txt -I
HTTP/1.1 301 Moved Permanently
Server: nginx/1.12.1
Date: Tue, 13 Mar 2018 16:37:07 GMT
Content-Type: text/html
Content-Length: 185
Connection: keep-alive
Location: http://test.com/123.txt

轉載于:https://blog.51cto.com/12058686/2086293

總結

以上是生活随笔為你收集整理的12.6 Nginx安装 12.7 默认虚拟主机 12.8 Nginx用户认证 12.9 Nginx的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 免费无遮挡网站 | 超碰日日夜夜 | 国产精久久久久久 | 日韩中文字幕二区 | www夜插内射视频网站 | 色5月婷婷 | av高清 | 性欧美18一19性猛交 | 久久av高潮av | 日韩欧美在线观看一区二区 | 下面一进一出好爽视频 | 国产精品麻豆视频 | 99视频久 | 天天爽| 欧美乱大交xxxxx春色视频 | 免费中文字幕视频 | 欧美日韩精选 | 男男做爰猛烈叫床爽爽小说 | 黄色a级片视频 | 91天天看 | 人人爽夜夜爽 | 视频在线一区二区三区 | 日韩欧美视频在线免费观看 | 日本特黄色片 | 在线免费你懂的 | 亚洲精品国产乱伦 | 国产精品揄拍100视频 | 污视频在线 | 免费av导航 | 国产孕妇孕交大片孕 | 色噜噜噜 | 国产精品第一 | 欧美久久精品一级黑人c片 1000部多毛熟女毛茸茸 | 欧美女优在线观看 | 亚洲欧洲精品一区二区 | 亚洲最大在线观看 | 亚洲区小说 | 污视频在线免费观看 | 欧美色妞网 | 午夜爽爽爽| 天堂在线亚洲 | av基地网 | 成人福利午夜 | 特级西西人体 | 四虎精品一区二区三区 | 免费av电影网址 | 欧美xxxxbbbb | 久久99久久久 | 国产一区二区在线观看免费 | 欧美一级在线观看视频 | 国产无码精品在线观看 | 欧美日韩精品一区二区三区蜜桃 | 在线中文字幕播放 | 日本韩国中文字幕 | 日韩在线www | 超碰日韩| 女生和男生一起插插插 | 亚洲视频在线观看网址 | 午夜精品一区 | 国产传媒视频在线观看 | a天堂在线观看视频 | 天天躁日日躁aaaa视频 | 国产精品毛片一区二区在线看舒淇 | 久久免费精品国产 | 自拍偷拍三级 | 美女啪啪av | 岛国av在线免费观看 | 久久久久久久久免费看无码 | 中文字幕四区 | 亚洲一区在线不卡 | 久久久久夜夜夜精品国产 | 男女乱淫视频 | 91 免费看片 | 九九这里只有精品视频 | 免费看国产曰批40分钟粉红裤头 | 在线国产网站 | 亚洲精品一区二区三区在线 | 色站在线 | 中文字幕avav| 久久久av一区二区三区 | 黄色一机片 | 国产99久久久欧美黑人 | 国产在线一区二区视频 | www.白丝| 咪咪色影院 | 青青草av | 五月婷婷丁香激情 | 另类性姿势bbwbbw | 日韩一区二区三区高清 | 精品网站 | 精品久久久久久久久久久久久久久 | 日日干影院 | 成人免费在线看片 | 有奶水的迷人少妇 | 国产一区二区三区视频免费观看 | 国产91免费在线观看 | 中文字幕在线不卡 | 天天草夜夜草 | www色网站|