title: Nginx Config for IP Address URL
body: <p>I wish to setup my URL like this <code>https://IP_ADDRESS/</code>. I have already setup rails and puma and I'm struggling with the Nginx config. My server is on Ubuntu 16.04.</p>
  
  <p>/etc/nginx/sites-available/default :</p>
  
  <pre><code>upstream app-name-production-backend {
    server unix:///home/rails/apps/app-name/production/shared/sockets/puma.sock;
  }
  
  server {
      listen 80;
      listen [::]:80 ipv6only=on;
  
      root /home/rails/apps/app-name/production/current/public/;
  
      index index.html index.htm index.nginx-debian.html;
  
      server_name _;
  
      location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_redirect off;
  
        if (!-f $request_filename) {
          proxy_pass http://app-name-production-backend;
          break;
        }
      }
  }
  </code></pre>
  
  <p>Is my Nginx config correct?</p>