From 508dcff6193ad605e88b828c86d092ec31456311 Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Sun, 31 Jan 2021 11:57:05 -0500 Subject: updated to include htpasswd --- usr/local/etc/nginx/nginx.conf | 91 ++++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 39 deletions(-) (limited to 'usr/local/etc') diff --git a/usr/local/etc/nginx/nginx.conf b/usr/local/etc/nginx/nginx.conf index 555f7e0..efef87b 100644 --- a/usr/local/etc/nginx/nginx.conf +++ b/usr/local/etc/nginx/nginx.conf @@ -1,47 +1,60 @@ -server { - server_name theglassyladies.com; - listen 80; - rewrite ^/admin$ https://theglassyladies.com redirect; - rewrite ^/care$ https://theglassyladies.com redirect; - rewrite ^/faq$ https://theglassyladies.com redirect; - rewrite ^/privacy$ https://theglassyladies.com redirect; - rewrite ^/cart$ https://theglassyladies.com redirect; - rewrite ^/checkout$ https://theglassyladies.com redirect; - client_max_body_size 10M; - gzip on; - gzip_vary on; - #gzip_min_length 10240; - gzip_proxied expired no-cache no-store private auth; - gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml; - gzip_disable "MSIE [1-6]\."; - sendfile on; - sendfile_max_chunk 1m; - keepalive_timeout 65; - - location / { - root /var/www; - index index.html; - try_files $uri $uri/ /index.html; - } +worker_processes 1; - location /login { - auth_basic "Glassy Ladies only!"; - auth_basic_user_file /var/db/gl/.htpasswd; - } +events { + worker_connections 1024; +} - location /images/ { - root /var/db/gl/images; - autoindex on; - } +http { + include mime.types; + default_type application_octet-stream; - location /api/ { - proxy_pass http://localhost:9876/; + sendfile on; - limit_except GET OPTIONS { + server { + server_name theglassyladies.com; + listen 80; + rewrite ^/admin$ https://theglassyladies.com redirect; + rewrite ^/care$ https://theglassyladies.com redirect; + rewrite ^/faq$ https://theglassyladies.com redirect; + rewrite ^/privacy$ https://theglassyladies.com redirect; + rewrite ^/cart$ https://theglassyladies.com redirect; + rewrite ^/checkout$ https://theglassyladies.com redirect; + client_max_body_size 10M; + gzip on; + gzip_vary on; + #gzip_min_length 10240; + gzip_proxied expired no-cache no-store private auth; + gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml; + gzip_disable "MSIE [1-6]\."; + sendfile on; + sendfile_max_chunk 1m; + keepalive_timeout 65; + + location / { + root /var/www; + index index.html; + try_files $uri $uri/ /index.html; + } + + location /login { auth_basic "Glassy Ladies only!"; - auth_basic_user_file /var/db/gl/.htpasswd; + auth_basic_user_file /var/db/theglassyladies/.htpasswd; + } + + location /images/ { + root /var/db/gl/images; + autoindex on; } + + location /api/ { + proxy_pass http://localhost:9876/; + + limit_except GET OPTIONS { + auth_basic "Glassy Ladies only!"; + auth_basic_user_file /var/db/theglassyladies/.htpasswd; + } + } + } - + } - -- cgit v1.2.3 From 923a0c35ff2cc4bef05f9fc7f029932735a3a78c Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Sun, 31 Jan 2021 14:13:33 -0500 Subject: updated runtime files, added rc.d script for dichroism --- usr/local/etc/nginx/nginx.conf | 6 +++--- usr/local/etc/rc.d/dichroism | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 usr/local/etc/rc.d/dichroism (limited to 'usr/local/etc') diff --git a/usr/local/etc/nginx/nginx.conf b/usr/local/etc/nginx/nginx.conf index efef87b..c955077 100644 --- a/usr/local/etc/nginx/nginx.conf +++ b/usr/local/etc/nginx/nginx.conf @@ -38,11 +38,11 @@ http { location /login { auth_basic "Glassy Ladies only!"; - auth_basic_user_file /var/db/theglassyladies/.htpasswd; + auth_basic_user_file /var/db/theglassyladies/htpasswd; } location /images/ { - root /var/db/gl/images; + root /var/db/theglassyladies/images; autoindex on; } @@ -51,7 +51,7 @@ http { limit_except GET OPTIONS { auth_basic "Glassy Ladies only!"; - auth_basic_user_file /var/db/theglassyladies/.htpasswd; + auth_basic_user_file /var/db/theglassyladies/htpasswd; } } diff --git a/usr/local/etc/rc.d/dichroism b/usr/local/etc/rc.d/dichroism new file mode 100644 index 0000000..fba6f7c --- /dev/null +++ b/usr/local/etc/rc.d/dichroism @@ -0,0 +1,11 @@ +#!/bin/sh + +. /etc/rc.subr + +name="dichroism" +rcvar="${name}_enable" +command="/usr/local/bin/${name}" +start_cmd="cd /var/db/theglassyladies; ${command}" +load_rc_config $name +run_rc_command "$1" + -- cgit v1.2.3 From e0a28e8922ec89e8ab0142bf511ae81e31fcfb88 Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Sun, 31 Jan 2021 20:33:31 -0500 Subject: fixed image root being wrong --- usr/local/etc/nginx/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr/local/etc') diff --git a/usr/local/etc/nginx/nginx.conf b/usr/local/etc/nginx/nginx.conf index c955077..bb2f09a 100644 --- a/usr/local/etc/nginx/nginx.conf +++ b/usr/local/etc/nginx/nginx.conf @@ -42,7 +42,7 @@ http { } location /images/ { - root /var/db/theglassyladies/images; + root /var/db/theglassyladies; autoindex on; } -- cgit v1.2.3 From c2b8b817a80d7b8c8a756b5f099329d8e5bc1837 Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Sun, 31 Jan 2021 20:39:47 -0500 Subject: auto worker_processes --- usr/local/etc/nginx/nginx.conf | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'usr/local/etc') diff --git a/usr/local/etc/nginx/nginx.conf b/usr/local/etc/nginx/nginx.conf index bb2f09a..d049eec 100644 --- a/usr/local/etc/nginx/nginx.conf +++ b/usr/local/etc/nginx/nginx.conf @@ -1,4 +1,4 @@ -worker_processes 1; +worker_processes auto; events { worker_connections 1024; @@ -8,8 +8,6 @@ http { include mime.types; default_type application_octet-stream; - sendfile on; - server { server_name theglassyladies.com; listen 80; @@ -22,10 +20,10 @@ http { client_max_body_size 10M; gzip on; gzip_vary on; - #gzip_min_length 10240; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml; gzip_disable "MSIE [1-6]\."; + sendfile on; sendfile_max_chunk 1m; keepalive_timeout 65; -- cgit v1.2.3