当前位置: 首页 > news >正文

国内哪个网站是做电子元器件的中山网站改版

国内哪个网站是做电子元器件的,中山网站改版,自助建站系统哪个好用,西安稳定的seo一、 Nginx 相关使用。 相关命令 启动 nginx start nginx立即停止 nginx nginx -s stop平缓停止 nginx(已有请求不会意外停止) nginx -s quit重新加载配置文件 nginx -s reload二、Nginx conf 配置文件详解 参考文章皮卡丘的猫 server 配置项 server 可…

一、 Nginx 相关使用。

相关命令

  1. 启动 nginx

start nginx
  1. 立即停止 nginx

nginx -s stop
  1. 平缓停止 nginx(已有请求不会意外停止)

nginx -s quit
  1. 重新加载配置文件

nginx -s reload

二、Nginx conf 配置文件详解

参考文章@皮卡丘的猫

server 配置项

server 可以在 http 指令块中设置多个虚拟机

  • listen 监听端口
  • server_name localhost , ip , 域名
  • location 请求路由映射,匹配拦截
  • root 请求位置
  • index 首页设置
    server {listen       88; // 端口号server_name  localhost; // 域名location / {root   html;index  index.html index.htm;}}

三、Nginx 使用中相关报错

The system cannot find the file specified

错误信息:

nginx: [error] OpenEvent(“Global\ngx_reload_5988”) failed (2: The system cannot find the file specified)

可能出现原因:

  1. 可能是之前已经启动的 nginx 进行还在。
  2. 用双击 nginx.exe 的方式启动导致,最好实在 cmd 窗口中使用命令的方式启动。

解决办法:

可重新解压 nginx 压缩包处理此问题.

重新解压后,在 nginx 根目录下,执行命令 nginx -s reload 即可。

参考文章@搬砖的小伙儿

也可以执行下面 nginx 命令

参考文章@katy 的小乖


nginx -c ./conf/nginx.conf

nginx 不是内部或外部命令

错误信息:

当命令行窗口 报 nginx 不是内部或外部命令 错误时,说明 nginx 没有安装成功。

可能原因:

  1. nginx 没有安装成功。
  2. 执行命令的路径不对。(命令行唤出的路径不对.)

解决办法:

再 nginx 的根目录下 ,唤出命令行窗口,执行命令 nginx 即可。

(根目录: 跟 nginx.exe, conf,html 等文件夹同级的文件目录)


forbidden by its access permissions

错误信息:

bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)

可能原因:

端口被占用

参考文章@搬砖的小伙儿

解决办法:

在 conf 文件下的 nignx.conf 文件中,找到 listen 80; 换个端口即可

查看本地端口占用情况:

输入命令 netstat -ano就可以看到本机所有端口的使用情况,一般 80 端口在第一行

tasklist ,列出所有当前运行的进程


unknown directive dist

错误信息:

nginx: Lemerg. unknown directive dist”in D;nginx-1.20.2/conf/nginx.conf:47

nginx.conf: 47 ,47 表示出错的行数

可能原因:

  1. 可能是标点符号的中英文问题.
  2. 也可能是 访问的本地文件路径问题.

解决办法:

  1. 重新检查 nginx.conf 文件中 location配置项的路径是否正确.
  2. 检查报错代码行 标点符号的中英文

修改后的 location 配置项:

location / {root   html;index  dist   index.html;}

原 nginx.conf 文件 相关配置项.


#user  nobody;
worker_processes  1;#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;#pid        logs/nginx.pid;events {worker_connections  1024;
}http {include       mime.types;default_type  application/octet-stream;#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '#                  '$status $body_bytes_sent "$http_referer" '#                  '"$http_user_agent" "$http_x_forwarded_for"';#access_log  logs/access.log  main;sendfile        on;#tcp_nopush     on;#keepalive_timeout  0;keepalive_timeout  65;#gzip  on;server {listen       80;server_name  localhost;#charset koi8-r;#access_log  logs/host.access.log  main;location / {root   html;index  index.html index.htm;}#error_page  404              /404.html;# redirect server error pages to the static page /50x.html#error_page   500 502 503 504  /50x.html;location = /50x.html {root   html;}# proxy the PHP scripts to Apache listening on 127.0.0.1:80##location ~ \.php$ {#    proxy_pass   http://127.0.0.1;#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000##location ~ \.php$ {#    root           html;#    fastcgi_pass   127.0.0.1:9000;#    fastcgi_index  index.php;#    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-based configuration##server {#    listen       8000;#    listen       somename:8080;#    server_name  somename  alias  another.alias;#    location / {#        root   html;#        index  index.html index.htm;#    }#}# HTTPS server##server {#    listen       443 ssl;#    server_name  localhost;#    ssl_certificate      cert.pem;#    ssl_certificate_key  cert.key;#    ssl_session_cache    shared:SSL:1m;#    ssl_session_timeout  5m;#    ssl_ciphers  HIGH:!aNULL:!MD5;#    ssl_prefer_server_ciphers  on;#    location / {#        root   html;#        index  index.html index.htm;#    }#}}
http://www.yayakq.cn/news/546819/

相关文章:

  • 别人 网站 粘贴 html 推广宿迁网站搭建
  • vue.js做静态网站做网站 宁波
  • 别人发我网站外链会降权我吗网站维护一般多少钱
  • 河南怎样做网站推广短链接生成方案
  • 佛山顺德网站制作公司泰安网络公司名字
  • 网站建设申请空间南昌网页制作公司
  • 工程承包去哪个网站西安网站有哪些
  • 定制高端网站建设报价公共信息服务平台
  • 手机上那个网站做农产品推广比较好微信哪个公司开发
  • wordpress后台密码忘了网站底部优化文字
  • 管理系统 网站模板北京装修公司家装排名
  • dw旅游网站模板下载做网站后台要做些什么
  • 怎么建立一个网站存照片视频的链接wordpress onenote
  • 做网站的人叫什么软件玉树营销网站建设多少钱
  • 怎样给一个公司做网站改版wordpress m3u8播放器
  • 锐狐 网站 后台做网站搭建服务器要多少钱
  • 有口碑的徐州网站建设wordpress关键词插件吗
  • 网站开发中网页之间的连接形式有广州建设网站公司哪家好
  • 网站建设属于什么行业分类现在出入山西最新规定
  • 网站建设的系统简介网站背景设计
  • 蒙牛网站建设报价情况如何建立一个永久网站
  • 做配资网站wordpress推广联盟
  • 个人怎么做贷款网站金湖县城乡建设局网站
  • 做网站 怎么样找客户如何区分官方网站和空壳网站
  • 佛山企业网站建设公司建设银行网站打印消费账单
  • 做问卷的网站有那些国外的设计网站推荐
  • 凡网站建设网站项目团队介绍怎么写
  • 丰都专业网站建设公司惠安 网站建设公司
  • 网站后台安装用rp怎么做网站原型
  • 郑州做网站最好的公司个人网页设计作品ps