From 84a2a2902dd775802756aaed2d3cf5524fcb4750 Mon Sep 17 00:00:00 2001 From: Nicolas Bally Date: Fri, 26 Oct 2018 16:37:36 +0200 Subject: [PATCH] suite --- .../public/menu_items_controller.rb | 4 +-- app/models/contact.rb | 2 +- app/views/layouts/public.html.haml | 6 ++-- config/nginx.conf | 32 ++++++++++++++++--- 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/app/controllers/public/menu_items_controller.rb b/app/controllers/public/menu_items_controller.rb index d6411b4..dc4d569 100644 --- a/app/controllers/public/menu_items_controller.rb +++ b/app/controllers/public/menu_items_controller.rb @@ -74,12 +74,12 @@ class Public::MenuItemsController < ApplicationController require 'open-uri' - @articles_rss = JSON.parse(open('http://payresas.quartz.xyz/admin/articles/rss.xml?cat_id=3').read) + @articles_rss = JSON.parse(open('https://groupe-payre.fr/admin/articles/rss.xml?cat_id=3').read) - @breves_rss = JSON.parse(open('http://payresas.quartz.xyz/admin/articles/rss.xml?cat_id=3&breve=true').read) + @breves_rss = JSON.parse(open('https://groupe-payre.fr/admin/articles/rss.xml?cat_id=3&breve=true').read) diff --git a/app/models/contact.rb b/app/models/contact.rb index 0d5657c..74ec773 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -31,7 +31,7 @@ class Contact < ActiveRecord::Base :provenance_id => self.provenance_id } - api_url = "http://payresas.quartz.xyz/admin/contacts/api" + api_url = "https://groupe-payre.fr/admin/contacts/api" #api_url ="http://localhost:3030/admin/contacts/api" @c = Curl::Easy.new(api_url) do |curl| diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml index 33ef245..53082b3 100644 --- a/app/views/layouts/public.html.haml +++ b/app/views/layouts/public.html.haml @@ -172,7 +172,7 @@ %div{:class => "actu"} - .img.with_ratio{:style => "background-image:url('http://payresas.quartz.xyz#{article['image_url']}');background-size:100%;background-size:cover;", :data => {:ratio => 0.62}} + .img.with_ratio{:style => "background-image:url('https://groupe-payre.fr#{article['image_url']}');background-size:100%;background-size:cover;", :data => {:ratio => 0.62}} @@ -183,7 +183,7 @@ =simple_format article["description"] .cta - =link_to "http://payresas.quartz.xyz"+article["url"].to_s, :class => "btn", :target => "_blank" do + =link_to "https://groupe-payre.fr"+article["url"].to_s, :class => "btn", :target => "_blank" do =qit("Lire l'article") > .clear @@ -196,7 +196,7 @@ L'actu du groupe -@breves_rss[0..10].each do |article| - =link_to "http://payresas.quartz.xyz"+article["url"].to_s, :target => "_blank", :style => "text-decoration:none;" do + =link_to "https://groupe-payre.fr"+article["url"].to_s, :target => "_blank", :style => "text-decoration:none;" do %div{:class =>"breve"} .color{:style => "background:#{Category.find(article['category_id']).color};"} =l (Time.parse(article['date'].to_s)), :format => "%d %b" diff --git a/config/nginx.conf b/config/nginx.conf index 6b7db72..352637b 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -1,10 +1,12 @@ + + upstream payre3p_app_unicorn { server unix:/srv/www/web/payre3p_app/shared/tmp/unicorn.sock fail_timeout=0; } server { - listen [::]:80; - server_name payre3p.quartz.xyz ; + listen [::]:443 ssl; + server_name payreenergies.fr; root /srv/www/web/payre3p_app/current/public; try_files $uri/index.html $uri @unicorn; @@ -19,13 +21,35 @@ server { error_page 500 502 503 504 /500.html; client_max_body_size 4G; keepalive_timeout 10; + + ssl on; + ssl_certificate /etc/letsencrypt/live/payreenergies.fr/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/payreenergies.fr/privkey.pem; + + + include snippets/letsencrypt.conf; } server { listen [::]:80; - server_name www.payre3p.quartz.xyz; - rewrite ^(.*) http://payre3p.quartz.xyz$1 permanent; + server_name payre3p.quartz.xyz payreenergies.fr *.payreenergies.fr groupepayre.fr *.groupepayre.fr payreenergie.fr *.payreenergie.fr; + + return 301 https://payreenergies.fr$request_uri; + + include snippets/letsencrypt.conf; +} + +server { + listen [::]:443 ssl; + server_name www.payreenergies.fr; + ssl on; + ssl_certificate /etc/letsencrypt/live/payreenergies.fr/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/payreenergies.fr/privkey.pem; + + return 301 https://payreenergies.fr$request_uri; + + include snippets/letsencrypt.conf; }