unicornのhttps化 nginxに下記の設定してrebootしたらいけた。 うーん。後はredirect設定だな ----------------------------------------------------------------------------------#myapp1 upstream myapp1 { server unix:/home/vagrant/railsapp/myapp1/tmp/sockets/unicorn.sock fail_timeout=0; }#myapp2 upstream myapp2 { server unix:/home/vagrant/railsapp/myapp2/tmp/sockets/unicorn.sock fail_timeout=0; } server { listen 443 ssl; server_name localhost; access_log /var/log/nginx/ssl_access.log; error_log /var/log/nginx/ssl_error.log; ssl on; ssl_certificate /etc/nginx/ssl/server.crt; ssl_certificate_key /etc/nginx/ssl/server.key; ssl_session_timeout 5m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; client_max_body_size 100m; error_page 404 /404.html; error_page 500 502 503 504 /500.html; location /myapp1/ { root /home/vagrant/railsapp/myapp1; access_log /var/log/nginx/myapp1_access.log; error_log /var/log/nginx/myapp1_error.log; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_pass http://myapp1; } location /myapp2/ { root /home/vagrant/railsapp/myapp2; access_log /var/log/nginx/myapp2_access.log; error_log /var/log/nginx/myapp2_error.log; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_pass http://myapp2; } }
unicornのhttps化 nginxに下記の設定してrebootしたらいけた。 うーん。後はredirect設定だな --------------------------------------...
=======================================
http://ift.tt/1abnmbU
May 28, 2016 at 12:24PM
=======================================
unicornのhttps化
nginxに下記の設定してrebootしたらいけた。
うーん。後はredirect設定だな
----------------------------------------------------------------------------------
#myapp1
upstream myapp1 {
server unix:/home/vagrant/railsapp/myapp1/tmp/sockets/unicorn.sock fail_timeout=0;
}
#myapp2
upstream myapp2 {
server unix:/home/vagrant/railsapp/myapp2/tmp/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 443 ssl;
server_name localhost;
access_log /var/log/nginx/ssl_access.log;
error_log /var/log/nginx/ssl_error.log;
ssl on;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
client_max_body_size 100m;
error_page 404 /404.html;
error_page 500 502 503 504 /500.html;
location /myapp1/ {
root /home/vagrant/railsapp/myapp1;
access_log /var/log/nginx/myapp1_access.log;
error_log /var/log/nginx/myapp1_error.log;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://myapp1;
}
location /myapp2/ {
root /home/vagrant/railsapp/myapp2;
access_log /var/log/nginx/myapp2_access.log;
error_log /var/log/nginx/myapp2_error.log;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://myapp2;
}
}
nginxに下記の設定してrebootしたらいけた。
うーん。後はredirect設定だな
----------------------------------------------------------------------------------
#myapp1
upstream myapp1 {
server unix:/home/vagrant/railsapp/myapp1/tmp/sockets/unicorn.sock fail_timeout=0;
}
#myapp2
upstream myapp2 {
server unix:/home/vagrant/railsapp/myapp2/tmp/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 443 ssl;
server_name localhost;
access_log /var/log/nginx/ssl_access.log;
error_log /var/log/nginx/ssl_error.log;
ssl on;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
client_max_body_size 100m;
error_page 404 /404.html;
error_page 500 502 503 504 /500.html;
location /myapp1/ {
root /home/vagrant/railsapp/myapp1;
access_log /var/log/nginx/myapp1_access.log;
error_log /var/log/nginx/myapp1_error.log;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://myapp1;
}
location /myapp2/ {
root /home/vagrant/railsapp/myapp2;
access_log /var/log/nginx/myapp2_access.log;
error_log /var/log/nginx/myapp2_error.log;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://myapp2;
}
}
http://ift.tt/1abnmbU
May 28, 2016 at 12:24PM
コメント
コメントを投稿