1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00

Merge pull request #2068 from jvonau/home_page

Home page [NGINX should preserve box.lan etc, instead of redirecting to 172.18.96.1]
This commit is contained in:
A Holt 2019-12-19 11:43:52 -05:00 committed by GitHub
commit b55d54094c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 34 deletions

View file

@ -5,28 +5,23 @@
with_items:
- { src: "server.conf",dest: "/etc/nginx/" }
- { src: "nginx.conf",dest: "/etc/nginx/" }
- { src: "usb-lib.conf",dest: "/etc/nginx/conf.d/" }
- { src: "modules.conf",dest: "/etc/nginx/conf.d/" }
# - { src: "admin-console.ini",dest: "/etc/uwsgi/apps-enabled/" }
# the above should be enough once uwsgi is started
# - { src: "uwsgi.unit",dest: "/etc/systemd/system/uwsgi.socket" }
- { src: 'ports.conf' , dest: '/etc/{{ apache_service }}/' , mode: '0644' }
- { src: "ports.conf" , dest: "/etc/{{ apache_service }}/" }
- { src: "iiab.conf.j2",dest: "/etc/nginx/conf.d/iiab.conf" }
when: nginx_enabled
- name: Clean stale config files
file:
state: absent
path: '{{ item.path }}'
with_items:
- { path: "/etc/nginx/conf.d/usb-lib.conf" }
- { path: "/etc/nginx/conf.d/modules.conf" }
- name: Insure that apache2 is not running -- we may need port swap
systemd:
name: apache2
state: stopped
# optional services
- name: Install config for Admin Console
template:
src: admin-console-nginx.conf
# Comment one or the other to revert from nginx back to apache2, if required
# src: admin-console-apache.conf
dest: /etc/nginx/conf.d/admin-console.conf
when: admin_console_enabled and nginx_enabled
# the below slides in nginx's proxypass config files for apache on localhost
# via the ports.conf file installed above
- name: Install proxpass to apache running on localhost port {{ apache_port }}
@ -73,10 +68,3 @@
state: restarted
enabled: true
when: nginx_enabled
#- name: Enable the uwsgi systemd service
# systemd:
# name: uwsgi
# state: restarted
# enabled: true
# when: admin_console_enabled and nginx_enabled

View file

@ -1,10 +1,18 @@
location / {
rewrite ^/$ $1/{{ iiab_home_url }};
}
location /usb {
alias /library/www/html/local_content/;
autoindex on;
}
location /local_content/ {
autoindex on;
}
location /modules/ {
fancyindex on; # Enable fancy indexes.
fancyindex_exact_size off; # Output human-readable file sizes.
fancyindex_ignore index.htmlf rachel-index.php;
# autoindex on;
# autoindex_exact_size off;
# autoindex_format html;
# autoindex_localtime on;
}

View file

@ -8,7 +8,6 @@ server {
access_log {{ apache_log_dir }}/scripts.log scripts;
index index.php index.html index.htm;
rewrite ^/$ $scheme://$server_addr/home/;
# let individual services drop location blocks in conf.d
include /etc/nginx/conf.d/*;

View file

@ -1,7 +0,0 @@
location /usb {
alias /library/www/html/local_content/;
autoindex on;
}
location /local_content/ {
autoindex on;
}