-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx
112 lines (78 loc) · 2.4 KB
/
nginx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
apt install nginx
apt install ufw
ufw enable
ufw allow ssh
ufw allow 5000
ufw allow "Nginx Full"
cd /var/www/
rm -rf html
mkdir projectm
cd projectm
nano index.html
sudo systemctl reload nginx
rm /etc/nginx/sites-available/default
rm /etc/nginx/sites-enabled/default
nano /etc/nginx/sites-available/projectm
server {
listen 80;
location / {
root /var/www/projectm;
index index.html index.htm;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
try_files $uri $uri/ /index.html;
}
}
ln -s /etc/nginx/sites-available/projectm /etc/nginx/sites-enabled/projectm
systemctl start nginx
nano /etc/nginx/sites-available/projectm
location /api {
proxy_pass http://37.148.212.158:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
--------------------------------------------------
apt install npm
git clone [email protected]:bkmzci/projectm.git
npm install
nano /root/projectm/api/node_modules/whatwg-url/lib/encoding.js
const { TextEncoder, TextDecoder } = require("util");
--------------------------------------------------------------
--------------------------------
// mongodb ubuntuya indirme
sudo apt-get update
sudo apt-get install -y mongodb
sudo service mongodb start
sudo service mongodb status
mongo
use projectm
db.createCollection("domains")
-----------------------------------
--------------------------------------------------
npm i -g pm2
pm2 start --name api app.js
pm2 startup ubuntu
----------------------------------------------------
---------------------------------------------------------
cd client
rm -rf /var/www/projectm/*
mkdir /var/www/projectm/client
cp -r build/* /var/www/projectm/client
nano /etc/nginx/sites-available/projectm
location / {
root /var/www/projectm/client/;
index index.html index.htm;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
try_files $uri $uri/ /index.html;
}
-----------------------------------------------------------------