您好,欢迎来到钮旅网。
搜索
您的当前位置:首页linux中nginx配置访问路径

linux中nginx配置访问路径

来源:钮旅网

Linux中,配置nginx访问home文件夹汇总的eakom文件夹,其配置如下

server {
	listen       80;
	server_name  localhost;

	#charset koi8-r;

	#access_log  logs/host.access.log  main;

	location / {
	    root htm;
	    index  index.html index.htm;
	}
	location /eakom/ {
	    root /home;
	    autoindex on;
	    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;
	}
}

访问是出现异常

解决方案,在nginx.conf 配置文件中的第二行新增一行代码
user root;

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- niushuan.com 版权所有 赣ICP备2024042780号-2

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务