Comments (9)
Hi @Onumis ,
Thanks for reporting this problem. Moving the middleware up is probably acceptable. I will incorporate this in the next release.
from active-elastic-job.
@tawan experienced the same issue, after I enabled force_ssl on my env. @Onumis your solution works for me too, thanks.
@tawan many thanks for doing this gem, hope you will able to fix this issue soon.
from active-elastic-job.
@Onumis @AlexanderUlitin Hi, Version 1.4.4 supports SSL and is released.
from active-elastic-job.
@tawan many thanks to you for doing this. I'll test it over this week on staging env and will report here.
from active-elastic-job.
Awesome!
from active-elastic-job.
It works great on real instances. Thanks.
from active-elastic-job.
Has anyone run into this recently? I'm getting these http => https redirects again on 2.0.1.
from active-elastic-job.
I'm still getting this error 301, I'm using the version ~> 2.0 and I the version of the sqs is aws-sqsd/2.3
It could be caused by my web tier configuration for nginx?? also I have my production file with config.force_ssl = true
# Redirect to HTTPS
if ($http_x_forwarded_proto != "https") {
rewrite ^(.*)$ https://$host$request_uri permanent;
}
I really needs to redirect all traffic to htts
Any idea to solve this? :(
from active-elastic-job.
I solved the problem, I think basically SQS works over http not https so if you rewrite your request to https, sqs doesn't work, here is my .ebextension for nginx.
I also had to change the path of the worker, so that it can send the request to /active_job
. (You can change the name of the path, don't forget to change in the nginx file too.
I tested and it works
files:
"/opt/elasticbeanstalk/support/conf/webapp_healthd.conf":
owner: root
group: root
mode: "000644"
content: |
client_max_body_size 10M;
upstream my_app {
server unix:///var/run/puma/my_app.sock;
}
map $uri $preferred_proto {
default "https";
~^/(packs|public)/ "none";
~^/active_job "http";
~^/health "http";
}
log_format healthd '$msec"$uri"'
'$status"$request_time"$upstream_response_time"'
'$http_x_forwarded_for';
server {
sendfile on;
tcp_nopush on;
tcp_nodelay off;
gzip on;
gzip_http_version 1.0;
gzip_proxied any;
gzip_min_length 500;
gzip_disable "MSIE [1-6]\.";
gzip_types text/plain text/xml text/css
text/comma-separated-values
text/javascript application/x-javascript
application/atom+xml;
listen 80;
server_name _ localhost;
root /var/app/current/public;
error_page 405 = /active_job;
if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})T(\d{2})") {
set $year $1;
set $month $2;
set $day $3;
set $hour $4;
}
access_log /var/log/nginx/access.log main;
access_log /var/log/nginx/healthd/application.log.$year-$month-$day-$hour healthd;
try_files $uri/index.html $uri.html $uri @app;
if ($preferred_proto = "http") {
set $http_x_forwarded_proto $preferred_proto;
}
if ($preferred_proto = "none") {
set $preferred_proto $http_x_forwarded_proto;
}
if ($preferred_proto != $http_x_forwarded_proto) {
rewrite ^(.*) $preferred_proto://$host$request_uri redirect;
}
# App always use https
location @app {
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_pass http://my_app;
}
# WS support always use https
location /cable {
proxy_http_version 1.1;
proxy_set_header Upgrade "websocket";
proxy_set_header Connection "Upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $host;
proxy_pass http://my_app;
}
# Elastic active jobs don't use https
location /active_job {
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
# note the trailing slash here, it matters!
proxy_pass http://my_app/;
}
# Change packs for assets if you are using native compile assets for rails app
location /packs {
alias /var/app/current/public/packs;
gzip_static on;
gzip on;
expires max;
add_header Cache-Control public;
}
location /public {
alias /var/app/current/public;
gzip_static on;
gzip on;
expires max;
add_header Cache-Control public;
}
}
container_commands:
99_restart_nginx:
command: "service nginx restart || service nginx start"
from active-elastic-job.
Related Issues (20)
- Applying new patches HOT 1
- Job gets enqueued but code in perform function won't run HOT 10
- Very long delay when enqueuing new jobs (~38 seconds) HOT 2
- Rails6 ActiveJob::QueueAdapters::ActiveElasticJobAdapter::NonExistentQueue HOT 1
- Is this actively maintained? HOT 7
- ActionController::RoutingError (No route matches [POST] "/scheduled"): HOT 1
- Trigger Rails Job from Java Service
- update aws-sdk-sqs HOT 3
- Rails 6.1 - Running inside Docker
- Version bumps should automatically update integration testing Gemfile.lock files
- Add support for Rails 7 and Ruby 3 HOT 1
- Delete periodic task from cronjob.yaml HOT 1
- EB docker environment Nginx 502 gateway errors HOT 5
- Question regarding active_storage_analysis HOT 1
- /var/proxy/staging/nginx/conf.d/read_timeout.conf disappears HOT 4
- Configure queue url for multiple AWS accounts HOT 24
- SQS message timeout response
- Comparison to aws-sdk-sqs, and how to boot the worker? HOT 3
- periodic tasks are not verified? HOT 1
- 403 response on Docker Amazon Linux 2023
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from active-elastic-job.