This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Backend Architecture (Design Proposal) | |
[AWS DEMO](https://gist.githubusercontent.com/shijiezhou1/62de971da9cb8795a974739b11c4933b/raw/1eed6338564390bb697321c8163acb6214d6d107/aws.jpg) | |
Please provide a visualization with a detailed explanation on the client-server architecture proposed. | |
## API Gateway Integration | |
- To satisfy and meet the requirements, the backend for the software is using Amazon API Gateway which provides fully managed service. For example, it allows users to publish, create, monitor, and secure all APIs on any scale. Since they do not introduce the concepts of RPC even it was way faster than restful, we will just stick with RESTful, HTTP/HTTPs and Web-socket API. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name yourdomainname.com www.yourdomainname.com; | |
return 301 https://$server_name$request_uri; | |
} | |
server { | |
listen 443 ssl http2 default_server; | |
listen [::]:443 ssl http2 default_server; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app.js | |
const http = require('http'); | |
// Create an instance of the http server to handle HTTP requests | |
let app = http.createServer((req, res) => { | |
// Set a response type of plain text for the response | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
// Send back a response and end the connection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
location / { | |
# if you index.js is listening on port 3000 | |
# or for location | |
# proxy_pass http://0.0.0.0:3000 | |
proxy_pass http://127.0.0.1:3000 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo root:pass |sudo chpasswd root | |
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config; | |
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config; | |
sudo service sshd restart | |
# username: root | |
# password: pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# close iptables | |
service iptables stop | |
# prevent iptables restart on boot | |
chkconfig iptables off | |
# stop firewall | |
systemctl stop firewalld.service | |
# prevent firewall restart on boot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user nginx; | |
worker_processes 1; # cpu of your server | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.7' | |
services: | |
wordpress: | |
image: wordpress | |
container_name: wp | |
restart: always | |
ports: | |
- 8080:80 |
OlderNewer