#StackBounty: #ruby-on-rails #ssl #nginx #devise URI::InvalidComponentError (bad component(expected scheme component): : https):

Bounty: 50

I’m working on a Ruby on Rails web app and I’m using Devise for user/password and OmniAuth for authentication using social media accounts. And I’m also using Nginx.

Authentication with username/password worked perfectly. But when I added ssl certificate to Nginx. I’m now able to login. But when I logout I get the error message in the title URI::InvalidComponentError (bad component(expected scheme component): : https): and telling that I have an exception generated from:

def check_scheme(v)
  if v && parser.regexp[:SCHEME] !~ v
    raise InvalidComponentError,
      "bad component(expected scheme component): #{v}"
  end

How can I fix this problem in order for all types of authentications to work?

UPDATE

It throws the same exception after almost every redirect withing the web app. But redirects anyway, event user login. But it never logs out

*UPDATE 2 *

This question has more detailed description of my issue

This other question is another try to fix the issue

UPDATE 3

When I tried adding config.force_ssl = true to my environment .rb file, I get “page not found” and the following in ssl.error.log

2018/04/13 05:05:14 [error] 7317#0: *553 connect() failed (111: Connection refused) while connecting to upstream, client: <my laptop ip>, server: vps37181, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "<domain name>"
2018/04/13 05:05:14 [error] 7317#0: *553 open() "/var/www/<app-name>/public/50x.html" failed (2: No such file or directory), client: <my laptop ip>, server: vps37181, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "<domain name>"


Get this bounty!!!

#StackBounty: #nginx #amazon-web-services #ruby-on-rails #ruby #elastic-beanstalk AWS Elastic Beanstalk – Socket failure on Puma server…

Bounty: 50

I’ve been dealing with an, arguably, strange issue on a AWS Elastic Beanstalk environment. I’m getting the following nginx error when there are more than 300 connections on a single instance at a given time:

2018/03/23 20:56:53 [error] 5431#0: *4121 connect() to unix:///var/run/puma/my_app.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 🐙, server: _, request: “GET /api/v1/podcasts/ HTTP/1.1”, upstream: “http://unix:///var/run/puma/my_app.sock:/api/v1/podcasts/“, host: 🐙

My Puma config has

bind "unix:///var/run/puma/my_app.sock"

And the nginx config on the EC2 instance seems to have the socket properly set up (the default nginx config provided by EBS).

So yeah, I have no idea what’s causing this. Any ideas? Thanks!


Get this bounty!!!

#StackBounty: #nginx #proxy #reverse-proxy #proxypass #resolve Can't login or doing any action when using proxy_pass with Nginx

Bounty: 50

In my previous question here nginx resolve (point) everything to different ip except specific file and subdirectory I asked about resolving my whitelabel website and it’s pages to different ip but keep some subfolders and files on my server to load from. It turns out it’s quite simple to do it and final solution went out like this:

location /robots.txt {
   alias {DOCROOT};
}
server_name {SERVERNAME};
location ~ /.php$ {
    proxy_pass  10.10.10.10 <== whitelabel ip;
    proxy_set_header Host            {SERVERNAME};
    proxy_set_header X-Forwarded-For myaccount.whitelabelsite.com;
    proxy_redirect off;
    proxy_set_header Connection "Keep-Alive";
    proxy_buffering off;
}

So here I load everything from my whitelabel website under my domain but still keep robots.txt to load from my hosting and some other files.

The problem now is that I’m using this method I can’t login to my account on whitelabel site.

So {SERVERNAME} directive is basically my domain name mydomain.com and when I try to login to mydomain.com/aff/panel it opens the page, it doesn’t output any error but just refreshes the page and does nothing. Same goes if someone wants to make a booking or send an email form. It opens pages but doesn’t do any actions actually.

When I was using DNS redirection everything worked but now it’s not. Am I missing some proxy information or headers post/get actions forwarded to and from whitelabel?


Get this bounty!!!

#StackBounty: #nginx #proxy #reverse-proxy #proxypass #resolve Can't login or doing any action when using proxy_pass with Nginx

Bounty: 50

In my previous question here nginx resolve (point) everything to different ip except specific file and subdirectory I asked about resolving my whitelabel website and it’s pages to different ip but keep some subfolders and files on my server to load from. It turns out it’s quite simple to do it and final solution went out like this:

location /robots.txt {
   alias {DOCROOT};
}
server_name {SERVERNAME};
location ~ /.php$ {
    proxy_pass  10.10.10.10 <== whitelabel ip;
    proxy_set_header Host            {SERVERNAME};
    proxy_set_header X-Forwarded-For myaccount.whitelabelsite.com;
    proxy_redirect off;
    proxy_set_header Connection "Keep-Alive";
    proxy_buffering off;
}

So here I load everything from my whitelabel website under my domain but still keep robots.txt to load from my hosting and some other files.

The problem now is that I’m using this method I can’t login to my account on whitelabel site.

So {SERVERNAME} directive is basically my domain name mydomain.com and when I try to login to mydomain.com/aff/panel it opens the page, it doesn’t output any error but just refreshes the page and does nothing. Same goes if someone wants to make a booking or send an email form. It opens pages but doesn’t do any actions actually.

When I was using DNS redirection everything worked but now it’s not. Am I missing some proxy information or headers post/get actions forwarded to and from whitelabel?


Get this bounty!!!

#StackBounty: #nginx #proxy #reverse-proxy #proxypass #resolve Can't login or doing any action when using proxy_pass with Nginx

Bounty: 50

In my previous question here nginx resolve (point) everything to different ip except specific file and subdirectory I asked about resolving my whitelabel website and it’s pages to different ip but keep some subfolders and files on my server to load from. It turns out it’s quite simple to do it and final solution went out like this:

location /robots.txt {
   alias {DOCROOT};
}
server_name {SERVERNAME};
location ~ /.php$ {
    proxy_pass  10.10.10.10 <== whitelabel ip;
    proxy_set_header Host            {SERVERNAME};
    proxy_set_header X-Forwarded-For myaccount.whitelabelsite.com;
    proxy_redirect off;
    proxy_set_header Connection "Keep-Alive";
    proxy_buffering off;
}

So here I load everything from my whitelabel website under my domain but still keep robots.txt to load from my hosting and some other files.

The problem now is that I’m using this method I can’t login to my account on whitelabel site.

So {SERVERNAME} directive is basically my domain name mydomain.com and when I try to login to mydomain.com/aff/panel it opens the page, it doesn’t output any error but just refreshes the page and does nothing. Same goes if someone wants to make a booking or send an email form. It opens pages but doesn’t do any actions actually.

When I was using DNS redirection everything worked but now it’s not. Am I missing some proxy information or headers post/get actions forwarded to and from whitelabel?


Get this bounty!!!

#StackBounty: #nginx Nginx with-cc-opt and with-ld-opt configure options

Bounty: 200

When I run nginx -V I get something like this in the output.

--with-ld-opt='-lrt -ljemalloc -Wl,-z,relro' --with-cc-opt='-m64 -mtune=native -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wno-sign-compare -Wno-string-plus-int -Wno-deprecated-declarations -Wno-unused-parameter -Wno-unused-const-variable -Wno-conditional-uninitialized -Wno-mismatched-tags -Wno-c++11-extensions -Wno-sometimes-uninitialized -Wno-parentheses-equality -Wno-tautological-compare -Wno-self-assign -Wno-deprecated-register -Wno-deprecated -Wno-invalid-source-encoding -Wno-pointer-sign -Wno-parentheses -Wno-enum-conversion'

What is this and how to know which values need to go here when compiling nginx from source code ?


Get this bounty!!!

#StackBounty: #nginx #proxy #reverse-proxy #proxypass #resolve can't login or doing any action when using proxy_pass with nginx

Bounty: 50

In my previous question here nginx resolve (point) everything to different ip except specific file and subdirectory i asked about resolving my whitelabel website and it’s pages to different ip but keep some subfolders and files on my server to load from. It turns out it’s quite simple to do it and final solution went out like this:

location /robots.txt {
   alias {DOCROOT};
}
server_name {SERVERNAME};
location ~ /.php$ {
    proxy_pass  10.10.10.10 <== whitelabel ip;
    proxy_set_header Host            {SERVERNAME};
    proxy_set_header X-Forwarded-For myaccount.whitelabelsite.com;
    proxy_redirect off;
    proxy_set_header Connection "Keep-Alive";
    proxy_buffering off;
}

So here i load eveerything from my whitelabel website under my doman but still keep robots.txt to load from my hosting and some other files.

Problem now is that using this method i can’t login to my account on whitelabel site.

So {SERVERNAME} directive is basically my domain name mydomain.com and when i try to login to mydomain.com/aff/panel it opens the page, it doesn’t output any error but just refresh page and do nothing. Same goes if someone want to make booking or send email form. It opens pages but doesn’t do any actions actually.

When i was using DNS redirection everything worked but now it’s not. Am i missing some proxy informations or headers post/get actions forwarded to and from whitelabel?


Get this bounty!!!

#StackBounty: #nginx #proxy #reverse-proxy #proxypass #resolve can't login or doing any action when using proxy_pass with nginx

Bounty: 50

In my previous question here nginx resolve (point) everything to different ip except specific file and subdirectory i asked about resolving my whitelabel website and it’s pages to different ip but keep some subfolders and files on my server to load from. It turns out it’s quite simple to do it and final solution went out like this:

location /robots.txt {
   alias {DOCROOT};
}
server_name {SERVERNAME};
location ~ /.php$ {
    proxy_pass  10.10.10.10 <== whitelabel ip;
    proxy_set_header Host            {SERVERNAME};
    proxy_set_header X-Forwarded-For myaccount.whitelabelsite.com;
    proxy_redirect off;
    proxy_set_header Connection "Keep-Alive";
    proxy_buffering off;
}

So here i load eveerything from my whitelabel website under my doman but still keep robots.txt to load from my hosting and some other files.

Problem now is that using this method i can’t login to my account on whitelabel site.

So {SERVERNAME} directive is basically my domain name mydomain.com and when i try to login to mydomain.com/aff/panel it opens the page, it doesn’t output any error but just refresh page and do nothing. Same goes if someone want to make booking or send email form. It opens pages but doesn’t do any actions actually.

When i was using DNS redirection everything worked but now it’s not. Am i missing some proxy informations or headers post/get actions forwarded to and from whitelabel?


Get this bounty!!!

#StackBounty: #nginx #proxy #reverse-proxy #proxypass #resolve can't login or doing any action when using proxy_pass with nginx

Bounty: 50

In my previous question here nginx resolve (point) everything to different ip except specific file and subdirectory i asked about resolving my whitelabel website and it’s pages to different ip but keep some subfolders and files on my server to load from. It turns out it’s quite simple to do it and final solution went out like this:

location /robots.txt {
   alias {DOCROOT};
}
server_name {SERVERNAME};
location ~ /.php$ {
    proxy_pass  10.10.10.10 <== whitelabel ip;
    proxy_set_header Host            {SERVERNAME};
    proxy_set_header X-Forwarded-For myaccount.whitelabelsite.com;
    proxy_redirect off;
    proxy_set_header Connection "Keep-Alive";
    proxy_buffering off;
}

So here i load eveerything from my whitelabel website under my doman but still keep robots.txt to load from my hosting and some other files.

Problem now is that using this method i can’t login to my account on whitelabel site.

So {SERVERNAME} directive is basically my domain name mydomain.com and when i try to login to mydomain.com/aff/panel it opens the page, it doesn’t output any error but just refresh page and do nothing. Same goes if someone want to make booking or send email form. It opens pages but doesn’t do any actions actually.

When i was using DNS redirection everything worked but now it’s not. Am i missing some proxy informations or headers post/get actions forwarded to and from whitelabel?


Get this bounty!!!

#StackBounty: #nginx #proxy #reverse-proxy #proxypass #resolve can't login or doing any action when using proxy_pass with nginx

Bounty: 50

In my previous question here nginx resolve (point) everything to different ip except specific file and subdirectory i asked about resolving my whitelabel website and it’s pages to different ip but keep some subfolders and files on my server to load from. It turns out it’s quite simple to do it and final solution went out like this:

location /robots.txt {
   alias {DOCROOT};
}
server_name {SERVERNAME};
location ~ /.php$ {
    proxy_pass  10.10.10.10 <== whitelabel ip;
    proxy_set_header Host            {SERVERNAME};
    proxy_set_header X-Forwarded-For myaccount.whitelabelsite.com;
    proxy_redirect off;
    proxy_set_header Connection "Keep-Alive";
    proxy_buffering off;
}

So here i load eveerything from my whitelabel website under my doman but still keep robots.txt to load from my hosting and some other files.

Problem now is that using this method i can’t login to my account on whitelabel site.

So {SERVERNAME} directive is basically my domain name mydomain.com and when i try to login to mydomain.com/aff/panel it opens the page, it doesn’t output any error but just refresh page and do nothing. Same goes if someone want to make booking or send email form. It opens pages but doesn’t do any actions actually.

When i was using DNS redirection everything worked but now it’s not. Am i missing some proxy informations or headers post/get actions forwarded to and from whitelabel?


Get this bounty!!!