listen 80
- 需求:访问
1.1.1.1/api/hello
时转发到 ->127.0.0.1:9090/demo/hello
location ^~/api/ { proxy_pass http://127.0.0.1:9090/demo/; }
- 在浏览器输入
1.1.1.1/api/hello
即可访问
location /static/ {
root html/dist;
index index.html;
}
- 以上配置会访问路径为:
1.1.1.1/static/html/dist
下的文件
403
- 文件访问权限
chomd chmod -R 777
- 使用命令
ps aux|grep nginx
如果前三项并非全是root
在 配置文件中
- 文件访问权限