What this will cover
- Host a static website at S3
- Redirect
www.website.comtowebsite.com - Website can be an SPA (requiring all requests to return
index.html) - Free AWS SSL certs
- Deployment with CDN invalidation
| import { useState, useEffect } from "react"; | |
| import styled from "styled-components"; | |
| import VisuallyHidden from "components/visuallyHidden"; | |
| import Input from "components/customInput"; | |
| import CodeBlock from "components/codeBlock"; | |
| import Result from "components/result"; | |
| import Warning from "components/warning"; | |
| import oneDecimal from "utils/oneDecimal"; | |
| import GithubIcon from "components/githubIcon"; |
| import { showSuccessBanner } from '@rs/ui-toolkit'; | |
| import moment from 'moment'; | |
| import * as OfflinePluginRuntime from 'offline-plugin/runtime'; | |
| const SW_UPDATE_READY = 'SW_UPDATE_READY'; | |
| const WEBPACK_OFFLINE_CACHE_PREFIX = 'webpack-offline:'; | |
| const LAST_UPDATED_DATE = 'LAST_UPDATED_DATE'; | |
| // dates from cache names sorted | |
| const getDatesFromCacheNames = (keys: string[]) => |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| git config --global alias.co checkout | |
| git config --global alias.br branch | |
| git config --global alias.ci commit | |
| git config --global alias.st status | |
| git config --global alias.unstage 'reset HEAD --' | |
| git config --global alias.changes 'diff --cached' |
| @media screen and (min-width: 55rem) and (max-width:90rem) { | |
| } | |
| @media screen and (max-width: 55rem) { | |
| } |
| FROM nginx | |
| COPY nginx.conf /etc/nginx/conf.d/default.conf | |
| COPY ./build /usr/share/nginx/html | |
| RUN mkdir -p /etc/letsencrypt/archive/sotm.grapeup.com | |
| WORKDIR /etc/letsencrypt/archive/sotm.grapeup.com | |
| COPY fullchain1.pem ./fullchain1.pem | |
| COPY privkey1.pem ./privkey1.pem |
| worker_processes 1; | |
| daemon off; | |
| error_log /home/vcap/app/nginx/logs/error.log; | |
| events { worker_connections 1024; } | |
| http { | |
| charset utf-8; | |
| log_format cloudfoundry '$http_x_forwarded_for - $http_referer - [$time_local] "$request" $status $body_bytes_sent' | |
| ' ########## BEGINNING OF HEADER LOG ########## ' |
| worker_processes 1; | |
| daemon off; | |
| events {} | |
| # usage: sudo nginx -c ~/workspace/mercury-pilot/nginx/nginx-local.conf | |
| http { | |
| include /usr/local/etc/nginx/mime.types; |
| {"version":1,"resource":"file:///Users/pavlotymchuk/projects/js/rsapi/config/database.yml","entries":[{"id":"Ssc9.yml","timestamp":1652354899010}]} |