-
Notifications
You must be signed in to change notification settings - Fork 2
Deployment
Jakob Panten edited this page Nov 23, 2021
·
2 revisions
We have a server provided by the HTW Rechenzentrum. It is a Debian 10 Linux server. We are using it in order to showcase/stage our application HTW internally (VPN) and especially for the IMI showtime on 11.02.2022 to the participants.
There are two users (local, root) from which we use local to setup everything over SSH. Therefore the port 22 (ssh) has to be open. Also the ports 80 (http) and 443 (https) need to be open to serve the application.
On the server we use the following for serving our application:
-
ufw - firewall tool
- handy tool for managing firewall rules
-
pm2 - node process manager
- process manager keeps the node process running and restarts if it fails, also after server restart
- runs backend on localhost:5000 (callable from outside with reverse proxy under /api)
-
nginx - web server
- fast webserver for serving frontend (static) and being a reverse proxy to the node backend
- Cloudflare - nameserver and SSL certificate creation
-
Namecheap - domain registrar
- https://s-potify.fun
- needed for SSL certificate creation
server {
listen 80;
listen [::]:80;
server_name s-potify.fun www.s-potify.fun;
return 302 https://$server_name$request_uri;
}
server {
# SSL configuration
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/ssl/cert.pem;
ssl_certificate_key /etc/ssl/key.pem;
server_name s-potify.fun www.s-potify.fun;
root /var/www/html/;
index index.html index.htm index.nginx-debian.html;
location /api/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://localhost:5000/api/;
proxy_ssl_session_reuse off;
proxy_set_header Host $http_host;
proxy_cache_bypass $http_upgrade;
proxy_redirect off;
}
}