From fe933dccb3fb12627a705fea4fc1e705f7a9454c Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Mon, 28 Jun 2021 14:09:53 -0500 Subject: [PATCH] more apache2 --- roles/moodle/tasks/main.yml | 4 ++-- .../{022-moodle.j2 => 022-moodle.jv.unused} | 0 roles/moodle/templates/moodle-nginx.conf.j2 | 21 +++++++++++-------- .../templates/moodle-nginx.conf.j2.native | 16 -------------- .../templates/moodle-nginx.conf.j2.unused | 13 ++++++++++++ 5 files changed, 27 insertions(+), 27 deletions(-) rename roles/moodle/templates/{022-moodle.j2 => 022-moodle.jv.unused} (100%) delete mode 100644 roles/moodle/templates/moodle-nginx.conf.j2.native create mode 100644 roles/moodle/templates/moodle-nginx.conf.j2.unused diff --git a/roles/moodle/tasks/main.yml b/roles/moodle/tasks/main.yml index 621e30fb4..1a618363b 100644 --- a/roles/moodle/tasks/main.yml +++ b/roles/moodle/tasks/main.yml @@ -39,8 +39,8 @@ name: postgresql -- name: SHIM FOR NOW SO ALWAYS DO THE...Enable/Disable/Restart Apache - include_tasks: apache.yml +#- name: SHIM FOR NOW SO ALWAYS DO THE...Enable/Disable/Restart Apache +# include_tasks: apache.yml - name: Enable/Disable/Restart NGINX include_tasks: nginx.yml diff --git a/roles/moodle/templates/022-moodle.j2 b/roles/moodle/templates/022-moodle.jv.unused similarity index 100% rename from roles/moodle/templates/022-moodle.j2 rename to roles/moodle/templates/022-moodle.jv.unused diff --git a/roles/moodle/templates/moodle-nginx.conf.j2 b/roles/moodle/templates/moodle-nginx.conf.j2 index eea1b9f39..bbf2fabe0 100644 --- a/roles/moodle/templates/moodle-nginx.conf.j2 +++ b/roles/moodle/templates/moodle-nginx.conf.j2 @@ -1,13 +1,16 @@ -location /moodle { +location ^/moodle { + alias /opt/iiab/moodle; + try_files $uri $uri/ index.php =404; +} +location ~ /moodle/(.*)\.php { + root /opt/iiab/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; - proxy_pass http://127.0.0.1:{{ apache_port }}; -} - -location ~ ^/moodle.*\.php$ { - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header Host $host; - proxy_pass http://127.0.0.1:{{ apache_port }}; + include fastcgi_params; + fastcgi_index index.php; + fastcgi_pass php; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_NAME $fastcgi_script_name; } diff --git a/roles/moodle/templates/moodle-nginx.conf.j2.native b/roles/moodle/templates/moodle-nginx.conf.j2.native deleted file mode 100644 index bbf2fabe0..000000000 --- a/roles/moodle/templates/moodle-nginx.conf.j2.native +++ /dev/null @@ -1,16 +0,0 @@ -location ^/moodle { - alias /opt/iiab/moodle; - try_files $uri $uri/ index.php =404; -} -location ~ /moodle/(.*)\.php { - root /opt/iiab/; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header Host $host; - include fastcgi_params; - fastcgi_index index.php; - fastcgi_pass php; - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param SCRIPT_NAME $fastcgi_script_name; -} diff --git a/roles/moodle/templates/moodle-nginx.conf.j2.unused b/roles/moodle/templates/moodle-nginx.conf.j2.unused new file mode 100644 index 000000000..eea1b9f39 --- /dev/null +++ b/roles/moodle/templates/moodle-nginx.conf.j2.unused @@ -0,0 +1,13 @@ +location /moodle { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header Host $host; + proxy_pass http://127.0.0.1:{{ apache_port }}; +} + +location ~ ^/moodle.*\.php$ { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header Host $host; + proxy_pass http://127.0.0.1:{{ apache_port }}; +}