服务写入动态nginx.conf公司只是因为它很容易启动nginx.exe-cnginx.conf公司
我在ubuntu上遇到了一些问题。
-
nginx是用sudo安装的:
sudo apt-get install -y nginx-extras
在这之后,它在端口80上运行一个非常简单的http页面。这很好。我的配置正在使用其他端口。
当我的服务运行并尝试为新的配置文件运行nginx时,我遇到以下问题:
nginx -c "/mnt/sfroot/_sf_gateway/S-Innovations.ServiceFabric.GatewayApplication/nginx.conf"
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2018/09/24 13:32:42 [emerg] 5825#5825: mkdir() "/usr/share/nginx/cache/GatewayService" failed (2: No such file or directory)
我可以通过设置缓存有权限的位置来修复缓存。但是不管我做什么,它总是试图写入/var/log/nginx/错误.log.
我怎么办
-
终止默认nginx服务(如果需要)
-
运行一个不需要访问root用户(sudo)的新nginx服务