configure nginx as a webserver with puma for application without domain












0















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.



I do not have a domain so example.com is just used as a proxy_pass url but it doesnt seem to be working.



/etc/nginx/sites-enabled/example.com



    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;
}


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 http://example.com, it doesnt load my application.



What am i missing? how do i get my application to connect locally via nginx with no domain name on my cloud server.



Any help is appreciated.










share|improve this question



























    0















    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.



    I do not have a domain so example.com is just used as a proxy_pass url but it doesnt seem to be working.



    /etc/nginx/sites-enabled/example.com



        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;
    }


    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 http://example.com, it doesnt load my application.



    What am i missing? how do i get my application to connect locally via nginx with no domain name on my cloud server.



    Any help is appreciated.










    share|improve this question

























      0












      0








      0








      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.



      I do not have a domain so example.com is just used as a proxy_pass url but it doesnt seem to be working.



      /etc/nginx/sites-enabled/example.com



          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;
      }


      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 http://example.com, it doesnt load my application.



      What am i missing? how do i get my application to connect locally via nginx with no domain name on my cloud server.



      Any help is appreciated.










      share|improve this question














      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.



      I do not have a domain so example.com is just used as a proxy_pass url but it doesnt seem to be working.



      /etc/nginx/sites-enabled/example.com



          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;
      }


      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 http://example.com, it doesnt load my application.



      What am i missing? how do i get my application to connect locally via nginx with no domain name on my cloud server.



      Any help is appreciated.







      nginx webserver reverse-proxy puma proxypass






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 24 '18 at 13:23









      Kingsley SimonKingsley Simon

      78511745




      78511745
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53458588%2fconfigure-nginx-as-a-webserver-with-puma-for-application-without-domain%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53458588%2fconfigure-nginx-as-a-webserver-with-puma-for-application-without-domain%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Wiesbaden

          Marschland

          Dieringhausen