next.js, nginx, reverse-proxy, ssl
$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt| #Setup NextJS on Ubuntu server (Digital Ocean, EC2,...) Terminal Commands | |
| #based on my YouTube video | |
| #Recommended: An ubuntu server with at least 2 GB memory to handle npm run build | |
| #login to server | |
| ssh root@ip_address | |
| #Upgrade Server - may take a few minutes | |
| sudo apt update | |
| sudo apt upgrade |
| fun isCPF(document: String): Boolean { | |
| if (document.isEmpty()) return false | |
| val numbers = document.filter { it.isDigit() }.map { | |
| it.toString().toInt() | |
| } | |
| if (numbers.size != 11) return false | |
| //repeticao |
| # Sample Nginx config with sane caching settings for modern web development | |
| # | |
| # Motivation: | |
| # Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools. | |
| # These tools automatically deactivate all sorts of caching for you, so you always have a fresh | |
| # and juicy version of your assets available. | |
| # At some point, however, you want to show your work to testers, your boss or your client. | |
| # After you implemented and deployed their feedback, they reload the testing page – and report | |
| # the exact same issues as before! What happened? Of course, they did not have developer tools | |
| # open, and of course, they did not empty their caches before navigating to your site. |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |