nginx反向代理出现问题

xfhmbjs_ 2018-11-07 07:34:43
#user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;


events {
worker_connections 1024;
}


http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

include /etc/nginx/conf.d/*.conf;

server {
listen 8800;
server_name 221.211.9.41;
client_max_body_size 1024M;

location /rs-manage-sys {

proxy_pass http://10.21.1.98:8080/rs-manage-sys;
# proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
以上是我的nginx配置
...全文
400 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
bkdd 2018-12-25
  • 打赏
  • 举报
回复
location /rs-manage-sys/ proxy_pass http://10.21.1.98:8080/rs-manage-sys/; 分别加个斜杠试试,看哪个起作用
274795192 2018-11-09
  • 打赏
  • 举报
回复
主目录下放个favicon.ico 文件
xfhmbjs_ 2018-11-07
  • 打赏
  • 举报
回复
直接访问221.211.9.41:8800 是可以nginx欢迎页面的,但是访问221.211.9.41:8800/rs-manage-sys 进行反向代理的时候 却显示访问的页面出错了 是404 也就是找不到http://10.21.1.98:8080/rs-manage-sys这个项目地址
查找日志显示:
2018/11/07 19:28:21 [notice] 3305#3305: signal process started
2018/11/07 19:28:27 [error] 3306#3306: *49 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 218.7.194.46, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "221.211.9.41:8800"
2018/11/07 19:28:29 [error] 3306#3306: *52 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 218.7.194.46, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "221.211.9.41:8800"
2018/11/07 19:28:36 [error] 3306#3306: *52 "/usr/share/nginx/html/rs-manage-sys/index.html" is not found (2: No such file or directory), client: 218.7.194.46, server: localhost, request: "GET /rs-manage-sys/ HTTP/1.1", host: "221.211.9.41:8800"
2018/11/07 19:28:36 [error] 3306#3306: *52 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 218.7.194.46, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "221.211.9.41:8800"
报这个错 有大神知道什么原因吗

24,923

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Apache
社区管理员
  • Apache
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧