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
错误信息:
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的更多相关文章
- 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 ...
- Windows下Nginx配置SSL实现Https访问(包含证书生成)
Vincent.李 Windows下Nginx配置SSL实现Https访问(包含证书生成) Windows下Nginx配置SSL实现Https访问(包含证书生成) 首先要说明为什么要实现https ...
- Windows下Nginx Virtual Host多站点配置详解
Windows下Nginx Virtual Host多站点配置详解 此教程适用于Windows系统已经配置好Nginx+Php+Mysql环境的同学. 如果您还未搭建WNMP环境,请查看 window ...
- windows下nginx的启动关闭
Windows下Nginx的启动.停止等命令 在Windows下使用Nginx,我们需要掌握一些基本的操作命令,比如:启动.停止Nginx服务,重新载入Nginx等,下面我就进行一些简单的介绍. .启 ...
- Windows下Nginx的启动、停止等命令
Windows下Nginx的启动.停止等命令 在Windows下使用Nginx,我们需要掌握一些基本的操作命令,比如:启动.停止Nginx服务,重新载入Nginx等,下面我就进行一些简单的介绍.1.启 ...
- Windows下Nginx的启动、停止等命令(转)
Windows下Nginx的启动.停止等命令 在Windows下使用Nginx,我们需要掌握一些基本的操作命令,比如:启动.停止Nginx服务,重新载入Nginx等,下面我就进行一些简单的介绍.1.启 ...
- windows下nginx+fastcgi不能使用file_get_contents/curl/fopen的原因
这两天一直在搞windows下nginx+fastcgi的file_get_contents请求.我想,很多同学都遇到当file_get_contents请求外网的http/https的php文件时毫 ...
- Windows下Nginx实现负载均衡
Apache,Nginx Apache和Nginx都属于属于 静态页面服务器,都有插件支持动态编程语言处理,但Nginx的IO模比Apache更适合跑代理.所以一般都作为前端缓冲代理(Nginx的反向 ...
- [转]Windows 下 Nginx+IIS 使用
本文转自:https://blog.csdn.net/chihen/article/details/52698594 Windows 下 Nginx+IIS 使用 一.Nginx简介 Nginx (& ...
随机推荐
- Spark学习笔记(三)-Spark Streaming
Spark Streaming支持实时数据流的可扩展(scalable).高吞吐(high-throughput).容错(fault-tolerant)的流处理(stream processing). ...
- Python3-pymysql模块-数据库操作之MySQL
博客转载 http://www.cnblogs.com/alex3714/articles/5950372.html 代码示例 import pymysql conn = None cursor = ...
- 使用 Prometheus-Operator 监控 Calico
原文链接:https://fuckcloudnative.io/posts/monitoring-calico-with-prometheus-operator/ Calico 中最核心的组件就是 F ...
- .NET中一些关键词的意义
const关键字用于修改字段或局部变量的声明.它指定字段或局部变量的值是常数,不能被修改.例如: const int x = 0; public const double gravitationalC ...
- 线程的创建方式以及synchronize的使用
线程的两种创建方式 继承 Thread class Thr extends Thread { @Override public void run() { Thread.cur ...
- SpringCloud之OpenFeign
SpringCloud之openFeign Spring Cloud的子项目之一,Spring Cloud OpenFeign以将OpenFeign集成到Spring Boot应用中的方式,为微服务架 ...
- (私人收藏)Linux命令大全(修正版)
Linux命令大全(修正版) https://pan.baidu.com/s/1tPTv1PzCelBC_Eq-ASAOBg1yp3 文件传输 bye ftp ftpcount ftpshut ftp ...
- API测试之Postman使用全指南(原来使用 Postman测试API如此简单)
Postman Postman是一个可扩展的API开发和测试协同平台工具,可以快速集成到CI/CD管道中.旨在简化测试和开发中的API工作流. Postman 工具有 Chrome 扩展和独立客户端, ...
- CSS三种布局模型是什么?
在网页中,元素有三种布局模型:流动模型(Flow) 默认的.浮动模型 (Float).层模型(Layer).下面我们来看一下这三种布局模型. 三种布局模型介绍: 1.流动模型(Flow) 流动(Flo ...
- 不用破解版的 Navicat 了,几款免费且好用的 SQL 客户端送给你
我是风筝,公众号「古时的风筝」. 文章会收录在 JavaNewBee 中,更有 Java 后端知识图谱,从小白到大牛要走的路都在里面. 没别的意思,今天就是为了给你推荐几款 MySQL 客户端,这几款 ...