【Nginx】Nginx 初识

Posted by ARTROY on 2019-06-10

下载

进入 Nginx 官网点击 “download”,进行下载。选择的是稳定版本,入图所示
download
下载之后是一个压缩包,解压后放置了 “C盘” ,打包好的文件(即发布的文件)放置了 “D盘”。

配置及使用

1、直接编辑 “nginx-1.16.0” 文件夹下的 “conf” 的 “nginx.conf” 文件。主要端口及文件路径。
conf
1、D:\GetStarted\dva-order\dist 的修改成 D:/GetStarted/dva-order/dist,注意符号方向,会报 An error occurred 错误, 如下:
Error
2、不能设置已占用或非安全端口,会报 ERR_UNSAFE_PORT 错误 如下:
Error
2、在 “终端” 输入,进入 “C盘” 的解压后的文件:
cd C:\nginx-1.16.0\
3、查看版本 “nginx” 版本:
nginx -v
如报以下错误:
nginx_error
则修改命令行:
./nginx -v
nginx_version
4、开启服务:start nginx,如发现一个黑色弹框出现又消失,则开启成功。
5、浏览器打开 http://localhost:5000 即可浏览。

非安全端口

附录:Google Chrome 默认非安全端口列表,虽然以上方法可以解决问题,但建议尽量避免以下端口:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
1,    // tcpmux
7, // echo
9, // discard
11, // systat
13, // daytime
15, // netstat
17, // qotd
19, // chargen
20, // ftp data
21, // ftp access
22, // ssh
23, // telnet
25, // smtp
37, // time
42, // name
43, // nicname
53, // domain
77, // priv-rjs
79, // finger
87, // ttylink
95, // supdup
101, // hostriame
102, // iso-tsap
103, // gppitnp
104, // acr-nema
109, // pop2
110, // pop3
111, // sunrpc
113, // auth
115, // sftp
117, // uucp-path
119, // nntp
123, // NTP
135, // loc-srv /epmap
139, // netbios
143, // imap2
179, // BGP
389, // ldap
465, // smtp+ssl
512, // print / exec
513, // login
514, // shell
515, // printer
526, // tempo
530, // courier
531, // chat
532, // netnews
540, // uucp
556, // remotefs
563, // nntp+ssl
587, // stmp?
601, // ??
636, // ldap+ssl
993, // ldap+ssl
995, // pop3+ssl
2049, // nfs
3659, // apple-sasl / PasswordServer
4045, // lockd
6000, // X11
6665, // Alternate IRC [Apple addition]
6666, // Alternate IRC [Apple addition]
6667, // Standard IRC [Apple addition]
6668, // Alternate IRC [Apple addition]
6669, // Alternate IRC [Apple addition]


支付宝打赏 微信打赏

欣赏此文,打赏一下



-->