1

Application is running in server. But it is not accessible from browser.

sample config file --

server {
  listen [::]:80;
  server_name ..;
  access_log /var/log/..;
  error_log /var/log/..;

  location / {
    proxy_pass http://localhost-app;
    proxy_http_version 1.1;
    proxy_read_timeout 150s;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-HTTPS 0;
  }
}

upstream localhost-app {
  server 127.0.0.1:8081;
}

nginx version: nginx/1.10.3

Ubuntu 16.04.3 LTS

manashb
  • 179
  • 1
  • 1
  • 12
  • 1
    Is the app running on port 8081? Are you accessing nginx via ipv6? What error do you get in the browser? – janh Dec 19 '17 at 12:24
  • Hi @janh, App is running on port 8081. Browser error - server not found. What is accessing nginx via ipv6? can you help me to understand this – manashb Dec 19 '17 at 12:40
  • 1
    `listen [::]:80;` tells nginx to listen on ipv6, port 80. Maybe change that to `listen 80;` to have it listen on all interfaces. – janh Dec 19 '17 at 13:47
  • Added both the line listen 80 and listen [::]:80 so that server is available to both ipv4 and ipv6. But still not accessible from browser. Thanks for the ipv6 thing. It was not in my notice. – manashb Dec 19 '17 at 15:56

0 Answers0