Welcome! Log In Create A New Profile


Reverse proxy - variable

January 14, 2019 05:50PM
I've seen this asked and answered many times - and I've tried many of the suggestions posted, but still not able to get this to work.
I'm reverse-proxying to an internal IP inside an AWS VPC - eventually, I'd like to use a JavaScript function to give the correct IP, but for now I'm just hard-coding it in a variable.
I've tried all of the below, and none work:

server {
listen 80;
server_name myserver.com;
location / {
set $with_trailing_slash "";
#proxy_pass; #this works no problem.
#proxy_pass $with_trailing_slash; # This gets to the upstream but gives a 404;
#proxy_pass $with_trailing_slash$request_uri; # This spins forever
set $no_trailing_slash "";
#proxy_pass $no_trailing_slash; #spins forever;
#proxy_pass $no_trailing_slash$request_uri; #spins forever;
set $just_ip;
#proxy_pass http://$just_ip:8080/; #404;
#proxy_pass http://$just_ip:8080/$request_uri; #spins forever;
set $ip_in_quotes "";
#proxy_pass http://$ip_in_quotes:8080/; #404;
#proxy_pass http://$ip_in_quotes:8080; # spins forever;
proxy_pass http://$iplookup:8080/; # spins forever;
Subject Author Posted

Reverse proxy - variable

cboyke January 14, 2019 05:50PM

Re: Reverse proxy - variable

Francis Daly January 15, 2019 05:00PM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 72
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready