瀏覽代碼

nginx rotbot.subdomain

root 6 年之前
父節點
當前提交
20fbf360ec
共有 2 個文件被更改,包括 14 次插入27 次删除
  1. 0 26
      website/website/local_settings.py
  2. 14 1
      website_nginx.conf

+ 0 - 26
website/website/local_settings.py

@@ -1,26 +0,0 @@
-# SECURITY WARNING: keep the secret key used in production secret!
-SECRET_KEY = 'f_nxx)y&fw6*u#dd_du6y9&)1$q+a0!y38+6sk151+6)@1kxge'
-
-# SECURITY WARNING: don't run with debug turned on in production!
-DEBUG = True
-
-ALLOWED_HOSTS = ['*']
-
-
-# Database
-# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
-
-DATABASES = {
-    # 'default': {
-    #     'ENGINE': 'django.db.backends.sqlite3',
-    #     'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
-    # }
-    'default': {
-        'ENGINE': 'django.db.backends.postgresql_psycopg2',
-        'NAME': 'website',
-        'USER': 'website',
-        'PASSWORD': 'oGPnbiqh55QKLhmnKQgS92h74j0e9d6LE58cSsD1',
-        'HOST': '127.0.0.1',
-        'PORT': '5432',
-    }
-}

+ 14 - 1
website_nginx.conf

@@ -4,17 +4,30 @@ upstream django {
     #server 127.0.0.1:8001; # Web port socket for use with uwsgi-hello-world-test.py
 }
 
+# HTTPS redirect
 server {
 	listen 80 default_server;
 	listen [::]:80 default_server;
 	server_name _;
-	return 301 https://h0v1n8.nl/$request_uri;
+	#return 301 https://h0v1n8.nl$request_uri;
+	return 301 https://$request;
+}
+
+# RotBot redirect. rotbot.h0v1n8.nl is the pointer record for the vps, so the bot looks cooler on IRC.
+server {
+    listen 443 ssl;
+    listen [::]:443 ssl;
+    server_name rotbot.h0v1n8.nl;
+    ssl_certificate /etc/letsencrypt/live/h0v1n8.nl/fullchain.pem;
+    ssl_certificate_key /etc/letsencrypt/live/h0v1n8.nl/privkey.pem;
+    return 301 https://h0v1n8.nl/rotbot$request_uri;
 }
 
 # Configuration of the server
 server {
     # the port your site will be served on
     listen      443 ssl;
+    listen      [::]:443 ssl;
     # the domain name it will serve for
     server_name h0v1n8.nl www.h0v1n8.nl; # substitute your machine's IP address or FQDN
     ssl_certificate /etc/letsencrypt/live/h0v1n8.nl/fullchain.pem;