【发布时间】:2014-10-03 19:40:18
【问题描述】:
我只是将 nginx 设置为直接代理到 tomcat 应用服务器的网络服务器。 当用户连接到我的网站时,Nginx 应该将请求重定向到运行 tomcat 应用服务器的端口 8080。
我在运行 Redhat 7 的亚马逊 ec2 实例上做所有事情。
到目前为止,我所拥有的是:
nginx.conf file
user nginx;
worker_processes 1;
server {
listen 80;
server_name mydomainname;
access_log /var/log/nginx/example.log;
error_log /var/log/nginx/example.error.log;
location / {
proxy_pass http://localhost:8080/example/;
}
}
我得到的错误是 (13:权限被拒绝)同时连接到上游,客户端
这绝对是用户访问问题,但似乎无法解决。好像 nginx 没有权限重定向到 8080 端口。
另外,nginx在myuser下运行
root 15736 nginx: master process /usr/sbin/nginx
myuser 15996 nginx: worker process
root 16017 grep --color=auto nginx
我尝试使用 127.0.0.1 代替 localhost,但没有成功。 我也尝试将nginx.conf中的用户更改为myuser,仍然没有运气。 当我直接连接到应用程序服务器时,我没有任何问题。
Example URL of my tomcat http://mydomain:8080/example/
提前谢谢你。
【问题讨论】:
-
您在启动 nginx 服务器时收到错误消息?或请求网址?
-
我在请求 url 并且 Nginx 重定向到 50x.html 页面时收到错误消息。 Nginx 启动正常。
标签: tomcat nginx amazon-ec2 proxy webserver