nginx 配置如下 ,访问域名报错403错误
server{
listen 80;
server_name portal.oceanstone.cn;
#location / {
#root /app/site/portal.oceanstone.cn;
#index index.html index.htm;
#}
#location /site/portal.oceanstone.cn{
#root /app;
#index index.html index.htm;
#}
root /app/cms/apache-tomcat-9.0.52/webapps/ms-mcms/html/web;
index index.html index.htm;
location ~ \.(html|htm)$ {
root /app/cms/apache-tomcat-9.0.52/webapps/ms-mcms/html/web;
}
location /img/ {
root /app/;
autoindex on;
}
#location /api {
#proxy_pass http://127.0.0.1:8115/api;
#client_max_body_size 5000m;
# }
}
修改方法:
将 #user nobody; 改为 user root;
保存,重新启动nginx