Skip to content

Instantly share code, notes, and snippets.

@henhan
henhan / nginx_documentation.md
Last active January 23, 2025 13:37
Extend and override nginx config for Elastic Beanstalk Amazon Linux 2

Extend and override nginx config for Elastic Beanstalk Amazon Linux 2

Documentation on how to override or extend the default nginx config on Elastic Beanstalk running om Amazon Linux 2. Correct as of 2021-08-01. Also see the general documentation on how to extend linux servers.

All references to placing files refer to putting a file at this location in your application bundle. You should never modify a file directly at your Elastic Beanstalk server by ssh:ing to the server, since such a change will be wiped whenever your servers autoscale or if you rebuild your application completely.

Adding a new location block

The easiest extension is to add a new location block to the main server block. This can be done by placing a .conf file with a server block in the folder .platform/nginx/conf.d/elasticbeanstalk. Any such file is automatically included in the main server block.

Overriding the default location

@zeshhaan
zeshhaan / date-time-improved.js
Last active March 13, 2023 10:29
Custom Date Time in Webflow
var Webflow = Webflow || [];
Webflow.push(function() {
let timeFormatPT = new Date('{{wf {"path":"added-date","transformers":[{"name":"date","arguments":["YYYY-MM-DD hh:mm a"]\}],"type":"Date"\} }} PDT'.replace(/-/g, "/"))
// Automate Day Light Savings
const DLS = timeFormatPT.getTimezoneOffset()/60 === 7 ? 'PST' : 'PDT';
timeFormatPT = new Date(`{{wf {"path":"added-date","transformers":[{"name":"date","arguments":["YYYY-MM-DD hh:mm a"]\}],"type":"Date"\} }} ${DLS}`.replace(/-/g, "/"))
@realprabs
realprabs / Dockerfile
Created January 28, 2024 09:32
Docker setup for AdonisJS V6
FROM node:lts-alpine3.19 AS builder
COPY ./package.json /app/package.json
COPY ./package-lock.json /app/package-lock.json
WORKDIR /app
RUN npm install
COPY ./ /app
RUN npm run build
FROM node:lts-alpine3.19