找到nginx 安装目录下的conf目录下的nginx.conf 然后进行修改配置
修改后代码如下:
server {
listen 80;
server_name xx.xx.com;
location / {
root /usr/local/www;
index index.html index.htm;
}
client_max_body_size 100m;
proxy_connect_timeout 300s;
location /admin {
proxy_pass http://xx-admin/;
proxy_redirect default;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
然后 sudo /usr/local/nginx/sbin/nginx -s reload 重启 nginx服务
如果这个时候访问网站 出现403错误
可以使用
chmod -R 755 /usr
chmod -R 755 /usr/local
chmod -R 755 /usr/local/www
授予访问权限