Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP Error 301 #37

Closed
peterkle opened this issue May 28, 2016 · 5 comments
Closed

HTTP Error 301 #37

peterkle opened this issue May 28, 2016 · 5 comments
Labels

Comments

@peterkle
Copy link

Hi, I am getting a 301 error in my worker env logs, any idea why?

var/app/support/logs/access.log
127.0.0.1 - - [28/May/2016:02:04:30 +0000] "POST / HTTP/1.1" 301 5 "-" "aws-sqsd/2.0"

/var/log/aws-sqsd/default.log

2016-05-28T02:07:33Z message: sent to %[http://localhost:80]
2016-05-28T02:07:33Z http-err: 3d762187-16aa-409e-aa6f-ba21f2a2962a (995) 301 - 0.004
@tawan tawan added the bug label May 30, 2016
@tawan
Copy link
Collaborator

tawan commented Jul 17, 2016

Hi @peterkle

Is this issue still present? The gem's only responses are either 200 or 403 or it passes the request through to the rails stack. Given the response is 301 then this means that the request is passed through. Since the agent string is correct, I suspect that the request originates from a job in the queue which has not been enqueued by this gem. I'd recommend to check this possibility.

Cheers and thanks for the submission,

Tawan

@sauy7
Copy link

sauy7 commented Jul 21, 2016

@peterkle Has your worker app been configured to force SSL in config/production.rb?

# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
config.force_ssl = true

If so, the request to localhost:80 is being 301 redirected to localhost:443.

@btc
Copy link

btc commented Jul 22, 2016

@sauy7, this may be slightly off-topic, but I'm curious how you managed to force ssl behind the ELB while avoiding infinite redirect loop and also passing health checks. I'm assuming you're on Elastic Beanstalk with an auto-scaling group.

@sauy7
Copy link

sauy7 commented Jul 22, 2016

I didn't force SSL. I have a separate production_worker Rails environment for my worker tier. My Web tier (production environment) does force SSL. I've not yet setup health checks although that is something I will be looking at next (comments in issue #32 suggests a solution, do they not?)

Also off-topic: Whilst running separate Rails environments for the separate tiers may seem like overkill, I have other reasons for doing so (e.g., .ebextensions differ between the two tiers). I manage both tiers from a single codebase and branch and have created a custom rake task to deploy different artefacts (zip archives) from the same codebase (the worker tier excludes a subset of .ebextensions, the web tier excludes the cron.yml file).

@tawan
Copy link
Collaborator

tawan commented Sep 11, 2016

@peterkle Do you enforce SSL in the worker tier? If so, make sure that you use the latest version of this gem. We had an issue before version 1.4.4 but it had been fixed now.

@tawan tawan closed this as completed Sep 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants