File tree Expand file tree Collapse file tree 2 files changed +59
-6
lines changed Expand file tree Collapse file tree 2 files changed +59
-6
lines changed Original file line number Diff line number Diff line change
1
+ server {
2
+ listen 443 ssl http2;
3
+ listen [::]:443 ssl http2;
4
+
5
+ server_name sub.example.com;
6
+ set $base /var/www/sub.example.com;
7
+ root $base/public;
8
+
9
+ # SSL
10
+ ssl_certificate /etc/nginx/ssl/nginx.crt;
11
+ ssl_certificate_key /etc/nginx/ssl/nginx.key;
12
+
13
+ # security
14
+ include kloudboy/security.conf;
15
+
16
+ # index.php
17
+ index index.php;
18
+
19
+ # index.php fallback
20
+ location / {
21
+ try_files $uri $uri/ /index.php?$query_string;
22
+ }
23
+
24
+ # handle .php
25
+ location ~ \.php$ {
26
+ include kloudboy/php_fastcgi.conf;
27
+ }
28
+
29
+ # additional config
30
+ include kloudboy/general.conf;
31
+ include kloudboy/wordpress.conf;
32
+ }
33
+
34
+ # subdomains redirect
35
+ server {
36
+ listen 443 ssl http2;
37
+ listen [::]:443 ssl http2;
38
+
39
+ server_name *.sub.example.com;
40
+
41
+ # SSL
42
+ ssl_certificate /etc/nginx/ssl/nginx.crt;
43
+ ssl_certificate_key /etc/nginx/ssl/nginx.key;
44
+
45
+ return 301 https://sub.example.com$request_uri;
46
+ }
47
+
48
+ # HTTP redirect
49
+ server {
50
+ listen 80;
51
+ listen [::]:80;
52
+
53
+ server_name .sub.example.com;
54
+
55
+ return 301 https://sub.example.com$request_uri;
56
+ }
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
# GET ALL USER INPUT
3
- tput setaf 2; echo " Domain Name (eg. example.com)?"
3
+ tput setaf 2; echo " Domain Name (eg. sub. example.com)?"
4
4
read DOMAIN
5
5
tput setaf 2; echo " Username (eg. database name)?"
6
6
read USERNAME
@@ -12,15 +12,12 @@ tput setaf 2; echo "Sit back and relax :) ......"
12
12
sleep 1;
13
13
tput sgr0
14
14
cd /etc/nginx/sites-available/
15
-
16
- sudo wget -qO " $DOMAIN " https://raw.githubusercontent.com/bajpangosh/High-Traffic-wordpress-server-configuration/master/sites-available/example.com.conf
17
- sudo sed -i -e " s/example.com/$DOMAIN /" " $DOMAIN "
18
- sudo sed -i -e " s/www.example.com/$DOMAIN /" " $DOMAIN "
15
+ sudo wget -qO " $DOMAIN " https://raw.githubusercontent.com/bajpangosh/High-Traffic-wordpress-server-configuration/master/sites-available/sub.example.com.conf
16
+ sudo sed -i -e " s/sub.example.com/$DOMAIN /" " $DOMAIN "
19
17
sudo ln -s /etc/nginx/sites-available/" $DOMAIN " /etc/nginx/sites-enabled/
20
18
sudo mkdir -p /var/www/" $DOMAIN " /public
21
19
cd /var/www/" $DOMAIN /public"
22
20
cd ~
23
-
24
21
tput setaf 2; echo " Downloading Latest Wordpress...."
25
22
sleep 2;
26
23
tput sgr0
You can’t perform that action at this time.
0 commit comments