correction grâce au déploiement de lederailleur.org
authorrominique <romain.legoff@heureux-cyclage.org>
Tue, 30 Apr 2024 16:41:17 +0000 (18:41 +0200)
committerrominique <romain.legoff@heureux-cyclage.org>
Tue, 30 Apr 2024 16:41:17 +0000 (18:41 +0200)
creation_nouveau_site.yml
templates/nginx_http_server.j2
templates/nginx_paheko_common.j2
templates/nginx_paheko_server.j2
templates/nginx_www_common.j2
templates/nginx_www_server.j2

index 5f7712e..4759c12 100644 (file)
@@ -78,7 +78,7 @@
 
         - name: Générer un certififat avec certbot # noqa : command-instead-of-module
           become: true
-          ansible.builtin.command: 'certbot certonly -n --nginx -d {{ SITE }}.{{ DOMAIN }}.{{ TLD }}'
+          ansible.builtin.command: 'certbot certonly -n --nginx -d {{ config_ss_domain | default(SITE) }}.{{ DOMAIN }}.{{ TLD }}'
           register: certbot_log
           ignore_errors: true
           changed_when: false
index e7aa0e0..67c6aaf 100644 (file)
@@ -1,7 +1,6 @@
 server {
        listen 80;
-       server_name
-               {{ config_ss_domain | default(SITE) }}.{{ DOMAIN }}.{{ TLD }};
+       server_name {{ config_ss_domain | default(SITE) }}.{{ DOMAIN }}.{{ TLD }};
        disable_symlinks if_not_owner;
        access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/access.log main buffer=32k;
        error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/error.log warn;
index a30fd26..f4ae705 100644 (file)
@@ -1,4 +1,4 @@
-server_name {{ config_ss_domain }}.{{ DOMAIN }}.{{ TLD }};
+server_name {{ config_ss_domain | default(SITE) }}.{{ DOMAIN }}.{{ TLD }};
 root /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/www;
 
 location / {
index e522e3e..8f42629 100644 (file)
@@ -4,7 +4,7 @@ server {
        access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/access.log main buffer=32k;
        error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/error.log warn;
 {% if ssl_ready is defined and ssl_ready %}
-       return 301 https://{{ config_ss_domain }}.{{ DOMAIN }}.{{ TLD }}$request_uri;
+    return 301 https://$server_name$request_uri;
  }
 server {
        listen 443;
index 1168977..831a739 100644 (file)
@@ -1,7 +1,5 @@
-server_name
-    {{ DOMAIN }}.{{ TLD }}
-    {{ config_ss_domain }}.{{ DOMAIN }}.{{ TLD }};
-rewrite ^/(.*) http://{{ config_ss_domain }}.{{ DOMAIN }}.{{ TLD }}/$1 permanent;       
+server_name {{ DOMAIN }}.{{ TLD }} {{ config_ss_domain | default(SITE) }}.{{ DOMAIN }}.{{ TLD }};
+{# semble ne pas être nécessaire rewrite ^/(.*) http://{{ config_ss_domain | default(SITE) }}.{{ DOMAIN }}.{{ TLD }}/$1 permanent;        #}
 root /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/;
 index index.html;
 
index ace724b..fd9ba1f 100644 (file)
@@ -1,11 +1,10 @@
 server {
     listen 80;
     include /etc/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/common.conf;
-    server_name {{ DOMAIN }}.{{ TLD }};
     access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/access.log main buffer=32k;
     error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/error.log warn;
 {% if ssl_ready is defined and ssl_ready %}
-    return 301 https://{{ config_ss_domain }}.{{ DOMAIN }}.{{ TLD }}$request_uri;
+    return 301 https://$server_name$request_uri;
 }
 server {
     listen 443 ssl;