阿里云服务器安装配置nginx

时间:2021-09-09 07:02:04   收藏:0   阅读:28

服务器:
阿里云 Alibaba Cloud Linux

下载

安装

配置

配置文件位置:/usr/local/nginx/conf/nginx.conf
其他的不用变,主要看server:

  server {
        listen       80; # 端口
        server_name  localhost;
        index  index.html index.htm; # 默认文件,会在索引文件夹下,寻找index配置的文件
		
		##	alias 不包含url的路径
		## 比如url:http://ip/aaa
		## 服务器索引的文件是 /home/www/dist/index.html

        location /aaa/ {
            alias   /home/www/dist/;
        }
		
		##	root 包含url的路径
		## 比如url:http://ip/aaa
		## 服务器索引的文件是 /home/www/dist/aaa/index.html

        location /aaa/ {
            root /home/www/love/dist/;
        }
    }

运行

问题排查

原文:https://www.cnblogs.com/zhuyutang/p/15239592.html

评论(0)
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!