File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ server {
1414 add_header X-Content-Type-Options "nosniff" always;
1515 add_header X-XSS-Protection "1; mode=block" always;
1616
17- # Proxy to Next.js (port 3000)
17+ # Proxy to Next.js (port 3001 - avoiding conflict with Next Hire on 3000)
1818 location / {
19- proxy_pass http ://localhost:3000 ;
19+ proxy_pass http ://localhost:3001 ;
2020 proxy_http_version 1.1;
2121 proxy_set_header Upgrade $http_upgrade ;
2222 proxy_set_header Connection 'upgrade' ;
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ echo " === Setting up PayAI Guardian Frontend ==="
3+
4+ # Load NVM
5+ export NVM_DIR=" $HOME /.nvm"
6+ [ -s " $NVM_DIR /nvm.sh" ] && \. " $NVM_DIR /nvm.sh"
7+
8+ echo " 1. Installing frontend dependencies..."
9+ cd ~ /payai-guardian/client
10+ npm install --production 2>&1 | tail -5
11+
12+ echo " "
13+ echo " 2. Starting frontend on port 3001..."
14+ pm2 start ecosystem.config.js
15+
16+ echo " "
17+ echo " 3. Waiting 3 seconds..."
18+ sleep 3
19+
20+ echo " "
21+ echo " 4. Checking PM2 status..."
22+ pm2 list
23+
24+ echo " "
25+ echo " 5. Updating Nginx config..."
26+ sudo cp ~ /payaiguardian-nginx.conf /etc/nginx/sites-available/payaiguardian
27+ sudo nginx -t
28+ sudo systemctl reload nginx
29+
30+ echo " "
31+ echo " 6. Saving PM2 processes..."
32+ pm2 save
33+
34+ echo " "
35+ echo " === Setup Complete! ==="
36+ echo " "
37+ echo " Check if frontend is running:"
38+ curl -I http://localhost:3001
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ echo " === Setting up PayAI Guardian Frontend on Port 3001 ==="
3+
4+ # Create PM2 ecosystem file for frontend
5+ cat > ~ /payai-guardian/client/ecosystem.config.js << 'EOF '
6+ module.exports = {
7+ apps: [{
8+ name: 'payaiguardian-frontend',
9+ script: 'npm',
10+ args: 'start',
11+ cwd: '/home/ubuntu/payai-guardian/client',
12+ instances: 1,
13+ autorestart: true,
14+ watch: false,
15+ max_memory_restart: '500M',
16+ env: {
17+ NODE_ENV: 'production',
18+ PORT: 3001,
19+ NEXT_PUBLIC_API_URL: 'https://api.payaiguardian.raorajan.pro'
20+ }
21+ }]
22+ };
23+ EOF
24+
25+ echo " ✓ PM2 config created"
26+ echo " "
27+ echo " Now run these commands on the server:"
28+ echo " "
29+ echo " cd ~/payai-guardian/client"
30+ echo " npm install --production"
31+ echo " pm2 start ecosystem.config.js"
32+ echo " pm2 save"
33+ echo " "
34+ echo " Then upload the fixed nginx.conf and reload"
You can’t perform that action at this time.
0 commit comments