I have a Web Adaptor behind an nginx proxy. When I am outside here on the Big Bad Internet, I want it behind the proxy. My proxy apparently does the right thing, because when I hit https://bellman.wildsong.biz/arcgis/home it sends the request along to my hidden https://web-adaptor.arcgis.net/arcgis/home and I get the correct front door of ArcGIS Enterprise.
Then when I click through to log in, it redirects to https://web-adaptor.arcgis.net/arcgis/home/signin.html and thus it fails. How do I keep Web Adaptor from rewriting the URL to one that is unreachable? Is there a place to configure it to send back redirects that work?
I am thinking the response comes directly back from Web Adaptor and it knows nothing of the proxy, so it's doing what it feels is the right thing. Maybe I have to teach nginx to tell W.A. something in its headers?
Thanks -- Brian
Solved! Go to Solution.
You'll want to set the web context URL as per this doc:
You'll want to set the web context URL as per this doc:
THANKS I knew there was a doc I was not finding. It seems to work now. I set nginx as a reverse proxy with a few additional lines as suggested in the nginx documentation. The config added to nginx now looks like this:
location /arcgis/ {
proxy_pass https://laysan.wildsong.biz/arcgis/;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;}
See https://www.nginx.com/resources/wiki/start/topics/examples/likeapache/
Then I set properties on Portal to look like this:
{"WebContextURL":"https://bellman.wildsong.biz/arcgis"}
It's no longer sending me off to the internal address. On the first load it gave an error which I have seen a couple times before where the contents of the screen where the login/password form comes up instead contains and error message about a redirect uri. I reloaded the page and it has worked since.
Hi, I have a customer that uses nginx as a proxy server in DMZ, and acessing upstream IIS server in the internal network running webadaptor for ArcGIS Portal. When we use curl with following call:
curl -k https://<ip>/agsportal
location /agsportal/ {
proxy_pass https://<ip>/agsportal/;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Should I add handling redirect from the webadaptor server?
location /agsportal/ {
proxy_pass https://<ip>/agsportal/;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_intercept_errors on; error_page 301 302 307 = @handle_redirects; } location @handle_redirects { set $saved_redirect_location '$upstream_http_location'; proxy_pass $saved_redirect_location; }