2 Deployment
The game is deployed as a static site with Nginx on a Siemens AWS instance and secured with EntraID.
The game is contained in the home directory of the user ubuntu on the instance, at "/home/ubuntu/one-tech-game". The folder "/dist" within this directory is then copied over to "/var/www/game" after each successful build. Nginx serves the build with the following configuration file in "/etc/nginx/sites-available" which is symlinked to "/etc/nginx/sites-enabled".
server { |
listen 443 ssl http2; |
listen [::]:443 ssl http2; |
server_name localhost; |
|
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt; |
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key; |
|
root /var/www/game; |
index index.html; |
|
location / { |
try_files $uri $uri/ /index.html; |
} |
|
location = /docs { |
return 301 /docs/; |
} |
|
location /docs/ { |
alias /var/www/docs/; |
index index.html; |
} |
} |
server { |
listen 80; |
listen [::]:80; |
server_name localhost; |
return 301 https://$server_name$request_uri; |
} |
See https://nginx.org/en/docs/ for more information.