Windows PowerShell 中启动 Nginx 报错解决方案

简介: Windows PowerShell 中启动 Nginx 报错解决方案

首先看一下报错提示:

46eb0ee4add6454691a79875214aa732.png


我这里由于配置了多个 nginx.conf 配置文件,默认情况下,直接双击nginx.exe 即可运行,默认加载的是 conf\nginx.conf 配置文件。

那么有多个配置文件时,我们启动就需要指定加载配置文件了。

start nginx -c ./conf/nginx-2.conf
start 是启动命令
nginx 就是nginx.exe 服务
-c 表示指定配置路径参数
-c 后面的内容 ./conf/nginx-2.conf 表示你要加载的 nginx 配置文件

具体报错信息:
InvalidOperation: (:) [Start-Process],InvalidOperationException

+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand

PowerShell 在不使用绝对路径时会出现问题,所以这里我用绝对路径即可启动成功。

start E:\nginx-1.10.2\nginx.exe -c E:\nginx-1.10.2\conf\nginx-2.conf

4f786a67490c413a9ca74a0bc744e886.png

相关文章
|
2月前
|
SQL Apache Windows
Windows服务器80端口被占用的全面解决方案
在服务管理器中启动apache2服务,即可正常使用80端口。若系统中还安装了其他微软产品如sql等,也可尝试停止其服务进行测试,但请注意,SQL通常不会使用80端口,因此一般不会受到影响。以上就是关于80端口被system占用的详细解决方法,希望对你有所帮助。
|
22天前
|
安全 Linux iOS开发
Tenable Nessus 10.9.3 (macOS, Linux, Windows) - 漏洞评估解决方案
Tenable Nessus 10.9.3 (macOS, Linux, Windows) - 漏洞评估解决方案
145 0
Tenable Nessus 10.9.3 (macOS, Linux, Windows) - 漏洞评估解决方案
|
6月前
|
安全 Unix Linux
Veritas NetBackup 11 for Linux & Windows - 领先的企业备份和恢复解决方案
Veritas NetBackup 11 for Linux & Windows - 领先的企业备份和恢复解决方案
141 0
Veritas NetBackup 11 for Linux & Windows - 领先的企业备份和恢复解决方案
|
2月前
|
监控 数据安全/隐私保护 Windows
Veeam Data Platform 12.3.2 (Windows) - 数据保护和管理解决方案
Veeam Data Platform 12.3.2 (Windows) - 数据保护和管理解决方案
71 1
|
5月前
|
存储 安全 Linux
Nexpose 8.4.1 for Linux & Windows - 领先的漏洞管理解决方案
Nexpose 8.4.1 for Linux & Windows - 领先的漏洞管理解决方案
110 0
Nexpose 8.4.1 for Linux & Windows - 领先的漏洞管理解决方案
|
10月前
|
数据库 数据安全/隐私保护 Windows
Windows远程桌面出现CredSSP加密数据修正问题解决方案
【10月更文挑战第30天】本文介绍了两种解决Windows系统凭据分配问题的方法。方案一是通过组策略编辑器(gpedit.msc)启用“加密数据库修正”并将其保护级别设为“易受攻击”。方案二是通过注册表编辑器(regedit)在指定路径下创建或修改名为“AllowEncryptionOracle”的DWORD值,并将其数值设为2。
8744 3
|
11月前
|
应用服务中间件 Shell PHP
windows系统配置nginx环境运行pbootcms访问首页直接404的问题
windows系统配置nginx环境运行pbootcms访问首页直接404的问题
|
11月前
|
安全 Shell Linux
内网渗透测试基础——Windows PowerShell篇
内网渗透测试基础——Windows PowerShell篇
440 0
【Azure Web Job】Azure Web Job执行Powershell脚本报错 The term 'Select-AzContext' is not recognized as the name
【Azure Web Job】Azure Web Job执行Powershell脚本报错 The term 'Select-AzContext' is not recognized as the name
|
12月前
|
存储 Shell 开发工具
8-8|windows上Git报错
8-8|windows上Git报错