Score:0

nginx reverse Proxy some url can't be access

cn flag

i have some issue for something...

i want to make some proxy pass to some url..

server {
listen 80;
  location / {
    proxy_pass http://www.xxx.xxx/;
  }  
}

but the problems was : when i go to some url with http://109.365.52.12/user.php?user=gigantic i was go to the url it use http://www.xxx.xxx. but i dont want it i want it still in my url..

djdomi avatar
za flag
The Server block is not complete, please show us the complete block
djdomi avatar
za flag
`proxy_set_header Host $http_host; ` seems for IMHO to be missing
bluecolor avatar
cn flag
i just make that server block.. because i just want to make some kind of iframe if not in ngiins... but somekind of url was can't be do that.. so i asking how to fix that...
djdomi avatar
za flag
However to be easier, i suggest we chat on https://chat.stackexchange.com/rooms/126791/thechat
bluecolor avatar
cn flag
i can't talk because i need to do something with 20 but i dont know.. can you helping me with this??? and not to go there???
djdomi avatar
za flag
i already told you to add the host header to your block,, remind if its a public site that you will end in a redirect loop if you use http to https and https to http
bluecolor avatar
cn flag
what i want to know is *host $http_host; this was the one i copy all.. or its need somethingg to change?? with the url?? because i already try to input this.. and its still problem sir...
djdomi avatar
za flag
`server { listen 80; location / { proxy_pass http://www.xxx.xxx/; proxy_set_header Host http_host; } ` remind that the page must be http in case of http is used
bluecolor avatar
cn flag
alright i try it first....
bluecolor avatar
cn flag
hi there.. i make like you said.. but it was some problems... Error 1003 Ray ID: 66e0bacaa9550ace • 2021-07-13 07:17:06 UTC Direct IP access not allowed i got this was error.. when i do like that....
djdomi avatar
za flag
Please update your question instead of single comment answers, also post the LOG about the issues
bluecolor avatar
cn flag
i really new in here... and i dont know how.. but the i you ask me to try its really not working man... please really helping me... because i new in nginx and i want to learn about it...
djdomi avatar
za flag
you have an edit buttn down below your question, use it. However, please update your question because it is stil for me a X and Y problem
bluecolor avatar
cn flag
what you mean update my question?? its really my question sir. i use nginx only for to make nginx reverse proxy..... but some kind i can't use for the reverse proxy..
djdomi avatar
za flag
i give up, you are not willing to cooperate and accepting the basic rules of this Site.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.