first prep
This commit is contained in:
parent
5265236393
commit
423d4447f5
4 changed files with 54 additions and 3 deletions
6
Makefile
6
Makefile
|
@ -7,8 +7,10 @@ build:
|
|||
|
||||
install:
|
||||
openssl genrsa -out /etc/ssl/private/$(APP).key 2048
|
||||
openssl req -new -key /etc/ssl/private/$(APP).key -out /etc/ssl/certs/$(APP).csr -subj '/C=CH/ST=Zurich/L=Zurich/O=InterstellarNet/OU=NONE/CN=$(DOMAIN)'
|
||||
openssl req -new -key /etc/ssl/private/$(APP).key -out /etc/ssl/certs/$(APP).csr -config openssl.cnf
|
||||
openssl x509 -req -in /etc/ssl/certs/$(APP).csr -CA /root/ca.crt -CAkey /root/ca.key -CAcreateserial -out /etc/ssl/certs/$(APP).crt -days 500 -sha256
|
||||
cp nginx /etc/nginx/sites-enabled/$(APP)
|
||||
cp nginx.cnf /etc/nginx/sites-enabled/$(APP)
|
||||
echo -e "\nzone \"jetsearch.com\" {\n type master;\n file \"/etc/bind/db.jetsearch.com\";\n};" | tee -a /etc/bind/named.conf.local
|
||||
cp zonefile.cnf /etc/bind/db.$(DOMAIN)
|
||||
docker load -i $(APP).tar
|
||||
docker run -p 5000:5000 --name $(APP) --restart always -d $(APP)
|
||||
|
|
|
@ -2,7 +2,14 @@ server {
|
|||
listen 80;
|
||||
server_name jetsearch.com;
|
||||
|
||||
return 301 https://$host$request_uri;
|
||||
return 301 https://www.jetsearch.com$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name www.jetsearch.com;
|
||||
|
||||
return 301 https://www.jetsearch.com$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
|
@ -12,6 +19,16 @@ server {
|
|||
ssl_certificate /etc/ssl/certs/jet-search.crt;
|
||||
ssl_certificate_key /etc/ssl/private/jet-search.key;
|
||||
|
||||
return 301 https://www.jetsearch.com$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name www.jetsearch.com;
|
||||
|
||||
ssl_certificate /etc/ssl/certs/jet-search.crt;
|
||||
ssl_certificate_key /etc/ssl/private/jet-search.key;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:5000;
|
||||
proxy_set_header Host $host;
|
20
openssl.cnf
Normal file
20
openssl.cnf
Normal file
|
@ -0,0 +1,20 @@
|
|||
[ req ]
|
||||
default_bits = 2048
|
||||
distinguished_name = req_distinguished_name
|
||||
req_extensions = req_ext
|
||||
prompt = no
|
||||
|
||||
[ req_distinguished_name ]
|
||||
C = CH
|
||||
ST = Zurich
|
||||
L = Zurich
|
||||
O = InterstellarNet
|
||||
OU = NONE
|
||||
CN = jetsearch.com
|
||||
|
||||
[ req_ext ]
|
||||
subjectAltName = @alt_names
|
||||
|
||||
[ alt_names ]
|
||||
DNS.1 = jetsearch.com
|
||||
DNS.2 = www.jetsearch.com
|
12
zonefile.cnf
Normal file
12
zonefile.cnf
Normal file
|
@ -0,0 +1,12 @@
|
|||
$TTL 604800
|
||||
@ IN SOA ns.jetsearch.com. admin.jetsearch.com. (
|
||||
2
|
||||
604800
|
||||
86400
|
||||
2419200
|
||||
604800 )
|
||||
;
|
||||
@ IN NS ns.jetsearch.com.
|
||||
ns IN A 192.168.1.1
|
||||
@ IN A 192.168.1.1
|
||||
www IN A 192.168.1.1
|
Loading…
Reference in a new issue