PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, September 1, 2022

[FIXED] How to config nginx about proxy_pass?

 September 01, 2022     nginx, nginx-reverse-proxy     No comments   

Issue

I run tomcat and my nginx.conf like this enter image description here

If in http://127.0.0.1:8080/edu/b.html or http://192.168.0.102:8080/edu/b.html it's ok

If in http://192.168.0.102:9001/edu/b.html it can't work

my computer ip now is 192.168.0.102

enter image description here

error message

[error] 17810#17810: *12 connect() failed (111: Connection refused) while connecting to upstream, client: 192    .168.0.102, server: 192.168.0.102, request: "GET /edu/b.html HTTP/1.1", upstream: "http://127.0.0.1:8000/edu/b.html", host: "192.    168.0.102:9001"      

Where is error? What should I do?


Solution

It is trying to connect to http://127.0.0.1:8000/edu/b.html(upstream) instead of http://192.168.0.102:8080/edu/b.html. You need to change the upstream port in your nginx.conf



Answered By - Naman Arora
Answer Checked By - Marilyn (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing