1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

oversignts and corrections -- most now seem to work on rpi

This commit is contained in:
George Hunt 2019-10-16 00:47:49 +01:00 committed by Jerry Vonau
parent 4778ad5e3c
commit cffb6afecc
23 changed files with 452 additions and 23 deletions

View file

@ -0,0 +1,9 @@
location /admin {
proxy_pass http://127.0.0.1:{{ apache_port }}/admin;
}
location /cmd-service {
proxy_pass http://127.0.0.1:{{ apache_port }}/cmd-service;
}

View file

@ -0,0 +1,29 @@
location /admin {
# proxy_pass http://127.0.0.1:{{ apache_port }}/admin;
alias /opt/admin/console;
auth_pam "Secure zone";
auth_pam_service_name "nginx";
}
location ~ /admin/(.*)\.php$ {
alias /opt/admin/console/$1.php;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
fastcgi_pass php;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
include fastcgi_params;
}
location /cmd-service {
# proxy_pass http://127.0.0.1:{{ apache_port }}/cmd-service;
include uwsgi_params;
uwsgi_pass unix:///tmp/admin-console.sock;
}

View file

@ -0,0 +1,8 @@
[uwsgi]
uid = www-data
gid = www-data
socket = /tmp/admin-console.sock
chdir = /opt/admin/console
wsgi-file = cmd-service.wsgi
master = true
plugins = python

View file

@ -0,0 +1,59 @@
# NGINX configuration for KA Lite
#
# Upstream KA-Lite server uses port 7007
# Nginx proxy for KA-Lite uses port 8008
#
# If you want the website to be accessible at a different port, change
# PROXY_PORT = nnnn setting in /var/ka-lite/.kalite/settings.py
# and change the below accordingly.
upstream kalite {
server 127.0.0.1:7007;
}
server {
listen 8008;
# Default value, overwritten in nginx.d
set $kalite_home {{ kalite_root }};
include /etc/ka-lite/nginx.d/*.conf;
location /static {
alias $kalite_home/httpsrv/static/;
}
location /media {
alias $kalite_home/httpsrv/media/;
}
location /content {
alias $kalite_home/content/;
}
location /favicon.ico {
empty_gif;
}
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://kalite;
error_page 502 = @502;
}
location @502 {
types { }
default_type "text/html";
return 502 "
<BR>
<H1>KA-Lite might be busy - wait a few moments and then reload this page
<BR><BR>
<H2>If KA-Lite is still busy, get help from the system administrator
<H3>Error code: nginx 502 Bad Gateway (maybe the KA-Lite webserver is not working correctly)";
}
}

View file

@ -0,0 +1,3 @@
location /kiwix {
proxy_pass http://127.0.0.1:3000;
}

View file

@ -0,0 +1,80 @@
# IIAB notes: sites-enabled is for server declarations
# cond.d is for location declarations within the main server block
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type text/html;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log {{ apache_log_dir }}/access.log;
error_log {{ apache_log_dir }}/error.log;
log_format scripts '$request > $document_root$fastcgi_script_name $fastcgi_path_info';
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
# include a server file which in turn includes conf.d/*
include /etc/nginx/server.conf;
# include other sites
include /etc/nginx/sites-enabled/*.conf;
# define the upstream backend fastcgi for php
upstream php {
server unix:/run/php/php{{ php_version }}-fpm.sock;
}
}

View file

@ -0,0 +1,40 @@
server {
root {{ doc_root }};
server_name {{ iiab_hostname }};
listen 80;
access_log {{ apache_log_dir }}/access.log;
error_log {{ apache_log_dir }}/error.log;
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/*;
location ~ .*\.php$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
fastcgi_pass php;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
include fastcgi_params;
}
location /cgi-bin {
root /usr/lib;
}
# if you don't like seeing all the errors for missing favicon.ico in root
location = /favicon.ico { access_log off; log_not_found off; }
# if you don't like seeing errors for a missing robots.txt in root
location = /robots.txt { access_log off; log_not_found off; }
# this will prevent files like .htaccess .htpassword .secret etc from being served
location ~ /\. { deny all; }
}

View file

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

View file

@ -0,0 +1,13 @@
Unit]
Description=uWSGI Service
[Service]
ExecStart=/usr/local/bin/uwsgi --ini /etc/uwsgi/admin_console_wsgi.ini
Restart=always
RestartSec=5
KillSignal=SIGQUIT
Type=notify
NotifyAccess=all
[Install]
WantedBy=multi-user.target