错误信息:

2019/09/09 13:54:37 [crit] 796#7096: *1 GetFileAttributesEx() "F: ginx-1.12.2\html\dist" failed (123: The filename, directory name, or volume label syntax is incorrect), client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost:8081"

说明:本机windows环境下   玩nginx部署vue项目的时候, 访问http://localhost:8081/  出现了错误页面

然后我就去看日志,就是上边的错误信息。发现 错误信息中 应该是 nginx-1.12.2结果却是 ginx-1.12.2 。

原因:windows和linux不一样,windows中默认是 反斜杠\\\\\\\\\\\\\  而linux确是斜杠//////  结果根路径F:\nginx-1.12.2 中的  \n 就会被当成是换行,被转义处理。

解决办法:配置vue资源根目录的时候   F:\\nginx-1.12.2\html\dist     双反斜杠表示不转义。如果是linux就不会存在这个问题 我已经测试了

下边是windows的 nginx配置文件:

 //
#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 8081;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
#vue项目的根路径 windows是双反斜杠
root F:\\nginx-1.12.2\html\dist;
index index.html index.htm; try_files $uri $uri/ /index.html;
}
#访问后台接口的代理
location /api/ {
proxy_pass http://localhost:8080/;
} location = /favicon.ico {
log_not_found off;
access_log off;
} #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;
# }
#}
}

windows下nginx问题:[crit] 796#7096: *1 GetFileAttributesEx() "F: ginx-1.12.2\html\dist" failed (123: The filename, directory name, or volume label syntax is incorrect), client: 127.0.0.1, server: localho的更多相关文章

  1. 123: The filename, directory name, or volume label syntax is incorrect今天玩nginx的时候报错

    今天在win下玩nginx的时候 提示500错误 看了下nginx的logs  提示 123: The filename, directory name, or volume label syntax ...

  2. Windows下Nginx配置SSL实现Https访问(包含证书生成)

    Vincent.李   Windows下Nginx配置SSL实现Https访问(包含证书生成) Windows下Nginx配置SSL实现Https访问(包含证书生成) 首先要说明为什么要实现https ...

  3. Windows下Nginx Virtual Host多站点配置详解

    Windows下Nginx Virtual Host多站点配置详解 此教程适用于Windows系统已经配置好Nginx+Php+Mysql环境的同学. 如果您还未搭建WNMP环境,请查看 window ...

  4. windows下nginx的启动关闭

    Windows下Nginx的启动.停止等命令 在Windows下使用Nginx,我们需要掌握一些基本的操作命令,比如:启动.停止Nginx服务,重新载入Nginx等,下面我就进行一些简单的介绍. .启 ...

  5. Windows下Nginx的启动、停止等命令

    Windows下Nginx的启动.停止等命令 在Windows下使用Nginx,我们需要掌握一些基本的操作命令,比如:启动.停止Nginx服务,重新载入Nginx等,下面我就进行一些简单的介绍.1.启 ...

  6. Windows下Nginx的启动、停止等命令(转)

    Windows下Nginx的启动.停止等命令 在Windows下使用Nginx,我们需要掌握一些基本的操作命令,比如:启动.停止Nginx服务,重新载入Nginx等,下面我就进行一些简单的介绍.1.启 ...

  7. windows下nginx+fastcgi不能使用file_get_contents/curl/fopen的原因

    这两天一直在搞windows下nginx+fastcgi的file_get_contents请求.我想,很多同学都遇到当file_get_contents请求外网的http/https的php文件时毫 ...

  8. Windows下Nginx实现负载均衡

    Apache,Nginx Apache和Nginx都属于属于 静态页面服务器,都有插件支持动态编程语言处理,但Nginx的IO模比Apache更适合跑代理.所以一般都作为前端缓冲代理(Nginx的反向 ...

  9. [转]Windows 下 Nginx+IIS 使用

    本文转自:https://blog.csdn.net/chihen/article/details/52698594 Windows 下 Nginx+IIS 使用 一.Nginx简介 Nginx (& ...

随机推荐

  1. 【SpringMVC】

    前言

  2. MAC安装VMware fusion

    1.下载VMware fusion 11 https://www.vmware.com/cn/products/fusion/fusion-evaluation.html 2.安装后启用输入注册码 V ...

  3. github知名企业开源项目索引

    亚马逊:https://github.com/amzn 饿了么 https://github.com/ElemeFEhttp://lrd.ele.me/腾讯 https://github.com/Te ...

  4. 简单案例:form表单应用向后端发数据

    效果如下图: 先新建一Django项目. 最后在terminal执行python manage.py runserver 8090 运行djago程序 浏览器输入http://127.0.0.1:80 ...

  5. 数据的编码和解码--java例子

    昨天借了一本<网络程序设计实验教程(java语言)>,然后看了第一章,一个Swing例子,于是为大家分享一下! 关于数据的编码与解码,我觉得就例子而言已经交待得非常清楚了,两种方法做的. ...

  6. 关于延迟段创建-P1

    文章目录 1 疑问点 2 环境创建 2.1 创建用户 2.2 创建表test 2.3 查看表的段信息 2.4 延迟段创建相关参数 1 疑问点 P1页有句话说道: 在Oracle 11.2.0.3.0以 ...

  7. java动态代理基本原理及proxy源码分析一

    本系列文章主要是博主在学习spring aop的过程中了解到其使用了java动态代理,本着究根问底的态度,于是对java动态代理的本质原理做了一些研究,于是便有了这个系列的文章 为了尽快进入正题,这里 ...

  8. AbstractQueuedSynchronizer(AQS)抽丝剥茧深入了解JUC框架原理

    目录 简介 Lock简单实用 主体框架 原理解析 独占锁 AQS数据结构 CLH数据结构 acquire实现步骤 addWaiter acquireQueued shouldParkAfterFail ...

  9. celery 基础教程(一):工作流程,架构以及概念

    1.工作流程 celery通过消息进行通信,通常使用一个叫Broker(中间人)来协client(任务的发出者)和worker(任务的处理者). clients发出消息到队列中,broker将队列中的 ...

  10. js获取url并截取相应的字段,js解决url获取中文字段乱码问题

    相信url截取信息是一个很常用的小功能页面跳转传参的时候可以在A页面的url挂一些参数到B页面获取正常的页面传参都是以数字和英文为主正常情况下中文获取的时候是有乱码的所谓上有政策下有对策一个正常的ur ...