asp.net mvc - Azure VM NGINX Plus + Web App leads to 404 -


i'm working on nginx plus setup reverse proxy traffic management , routing on azure cloud solution.

i'm getting started , works independently, when try use proxy_pass route web traffic .net web app rests in cloud, 404 errors.

i've tried app i've had deployed while(a .net mvc web app) , node express app nothing more basic offering test: http://rpsexpressnodetest.azurewebsites.net/

each of these runs expected when go directly them, when enable pass thru 404 error.

i'm using following config file nginx:

user  nginx; worker_processes  auto;  error_log  /var/log/nginx/error.log notice; pid        /var/run/nginx.pid;   events {     worker_connections  1024; }  http {     upstream web_rps{         server rpsexpressnodetest.azurewebsites.net; }  #    ssl_certificate /etc/nginx/ssl/server.crt; #    ssl_certificate_key /etc/nginx/ssl/server.key;  #    drop requests no host header #    server{ #       listen 80 default_server; #       server_name ""; #       return 444; #    }  server{     listen *:80; #       listen *:443 ssl;     root /usr/share/nginx/html;      location / {         proxy_pass http://web_rps;     } }  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; } 

in case, if navigate http://rpsnginx.cloudapp.net/ (my nginx vm), 404 web app not found...

error 404 - web app not found.

the web app have attempted reach not available in microsoft azure app service region. due 1 of several reasons:

  1. the web app owner has registered custom domain point microsoft azure app service, has not yet configured azure recognize it. click here read more.

  2. the web app owner has moved web app different region, dns cache still directing old ip address used in previous region. click here read more.

if remove pass through proxy standard "welcome nginx" index.html file, nginx seems work fine too...

i sincerely hope new(b)ness causing issue.

any assistance great help!

first off, big props nginx support getting me transpose post email sent them...

more importantly, here answer provided them worked!

my guess this source of problem. try adding following directive "location /" block:

proxy_set_header host rpsexpressnodetest.azurewebsites.net; 

worked champ!


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -