Skip to content

Commit

Permalink
Moved ancillary config file to separate directory
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebrownlee committed May 3, 2023
1 parent de28aa9 commit 70e40e1
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 42 deletions.
2 changes: 0 additions & 2 deletions collect.sh

This file was deleted.

File renamed without changes.
35 changes: 35 additions & 0 deletions config/nginx.api.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
server {
server_name learningapi.nss.team;
access_log /var/log/nginx/api.log;

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-NginX-Proxy true;

include proxy_params;
proxy_pass http://127.0.0.1:8000;
}

location /static/ {
autoindex off;
root /var/www/learning.nss.team/;
}

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/learningapi.nss.team/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/learningapi.nss.team/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}


server {
if ($host = learningapi.nss.team) {
return 301 https://$host$request_uri;
} # managed by Certbot


listen 80;
server_name learningapi.nss.team;
return 404; # managed by Certbot
}
34 changes: 0 additions & 34 deletions seed.sh

This file was deleted.

7 changes: 1 addition & 6 deletions setup_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ sudo su - learnops -c "source ~/.bashrc"
# Install required software
#####
# sudo apt update -y
packages=("git" "curl" "python3-pip" "python3.10-venv" "postgresql" "postgresql-contrib")
packages=("git" "curl" "nginx" "certbot" "python3-pip" "python3.10-venv" "postgresql" "postgresql-contrib")

for package in "${packages[@]}"; do
if ! dpkg-query -W -f='${Status}\n' "$package" | grep -q "ok installed"; then
Expand Down Expand Up @@ -331,8 +331,3 @@ if [ "${SYSTEMD_PID}" == "" ]; then
else
sudo service learning start >> /dev/null
fi




# ExecStart=/usr/local/bin/gunicorn -w 3 --bind 127.0.0.1:8000 LearningPlatform.wsgi --log-level info --access-logfile /home/chortlehoort/www/logs/admin.gunicorn.access.log --error-logfile /home/chortlehoort/www/logs/admin.gunicorn.error.log --access-logformat '%%({X-REAL-IP}i)s %%(l)s %%(u)s %%(t)s "%%(r)s" %%(s)s %%(b)s "%%(f)s" "%%(a)s"'

0 comments on commit 70e40e1

Please sign in to comment.