title: configure nginx as a webserver with puma for application without domain
body: <p>I have a cloud server and my application is on my server. I currently do not have a domain but i would like to use nginx as a webserver for my application. So i configured in the nginx the following for this application. </p>
  
  <p>I do not have a domain so <code>example.com</code> is just used as a proxy_pass url but it doesnt seem to be working.</p>
  
  <p>/etc/nginx/sites-enabled/example.com</p>
  
  <pre><code>    upstream puma_example {
        server unix:///home/deploy/sites/example.com/shared/tmp/sockets/example.sock;
      }
  
      server {
        listen 80 ;
        server_name example.com;
  
        gzip on;
        gzip_http_version 1.0;
        gzip_disable "msie6";
        gzip_vary on;
        gzip_min_length 1100;
        gzip_buffers 64 8k;
        gzip_comp_level 3;
        gzip_proxied any;
        gzip_types text/css text/xml application/x-javascript application/atom+xml text/mathml text/plain text/vnd.sun.j2me.app-descriptor text/vnd.wap.wml text/x-component;
  
        root /home/deploy/sites/example.com/current/public;
        access_log /home/deploy/sites/example.com/current/log/nginx.access.log;
        error_log /home/deploy/sites/example.com/current/log/nginx.error.log info;
  
        location ^~ /assets/ {
          gzip_static on;
          expires max;
          add_header Cache-Control public;
        }
  
        try_files $uri/index.html $uri @puma_example;
        location @puma_example {
          proxy_set_header X-Forwarded-Proto http;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Host $http_host;
          proxy_redirect off;
  
          proxy_pass http://puma_example;
        }
  
    error_page 500 502 503 504 /500.html;
    client_max_body_size 25M;
    keepalive_timeout 10;
  }
  </code></pre>
  
  <p>When i run my rails application i can see that is running but i cant seem to link it via nginx. So when i so <code>http://example.com</code>, it doesnt load my application.</p>
  
  <p>What am i missing? how do i get my application to connect locally via nginx with no domain name on my cloud server.</p>
  
  <p>Any help is appreciated.</p>