NginxWindows详细安装部署教程1、下载nginx包
2、下载完成后,在指定位置解压缩,不要直接双击。
3、运⾏cmd,进⼊解压的指定⽬录下
currency是什么意思
4、启动nginx服务,启动命令为:start nginx,启动时会⼀闪⽽过是正常的
5、查看任务进程是否存在,命令:tasklist /fi "imagename "
6、进⼊解压缩⽬录,在conf⽬录下找到f使⽤txt⽂本打开即可,找到rver这个节点,进⾏修改
需修改的下图四个地⽅
⽂件内容如下
#ur nobody;
worker_process 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
applau
worker_connections 1024;
}
http {
include pes;
default_type application/octet-stream;
报考预算员的条件hortail#log_format main '$remote_addr - $remote_ur [$time_local] "$request" ' # '$status $body_bytes_nt "$http_referer" '
# '"$http_ur_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
ndfile on;
#tcp_nopush on;
自考培训#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
rver {
listen 8888;//输⼊端⼝号
rver_name localhost;
#chart koi8-r;
#access_log logs/host.access.log main;
location / {
root D:/nginx-1.16.1/html/dist; //输⼊包的地址
index index.html index.htm;
try_files $uri $uri/ @router;
}
location @router{
#rewrite ^.*/index.html last;
rewrite ^(.+)$ /index.html last;
}
#error_page 404 /404.html;
# redirect rver error pages to the static page /50x.html
#
error_page 500502503504 /50x.html;mye
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass 127.0.0.1;simple cd
#}
# pass the PHP scripts to FastCGI rver listening on 127.0.0.1:9000 #
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
钢铁侠3英文版# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-bad configuration
#
#rver {
# listen 8000;
# listen somename:8080;
# rver_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS rver
#
#rver {
# listen 443 ssl;
# rver_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_ssion_cache shared:SSL:1m;
# ssl_ssion_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_rver_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
7、修改完成后保存,使⽤以下命令检查⼀下配置⽂件是否正确,后⾯是f⽂件的路径,successful就说明正确了命令:nginx -t -c /nginx-1.16.1/f
8、如果程序没启动就直接start nginx启动,如果已经启动了就使⽤以下命令重新加载配置⽂件并重启
命令:nginx -s reload
9、之后就打开浏览器访问刚才的域名及端⼝localhost:8888,出现欢迎页就说明部署成功了
绅士的英文
10、关闭nginx服务使⽤以下命令,同样也是⼀闪⽽过是正常的,看⼀下是否进程已消失即可
快速停⽌:nginx -s stop
完整有序的关闭:nginx -s quit
container是什么意思11、把安装包放在D:\nginx-1.16.1\html⽬录下,进⾏解压
12、在dos指定路径下,输⼊命令:nginx -s reload,重启
13、打开浏览器访问localhost:8888,就可以访问⾃⼰的项⽬了