Skip to content

Instantly share code, notes, and snippets.

View maullerz's full-sized avatar

Loginov Roman maullerz

View GitHub Profile
@maullerz
maullerz / nginx.conf
Created April 3, 2024 03:23 — forked from hlubek/nginx.conf
Nginx reverse proxy with caching for Next.js with imgproxy
# Based on https://steveholgado.com/nginx-for-nextjs/
# - /var/cache/nginx sets a directory to store the cached assets
# - levels=1:2 sets up a two‑level directory hierarchy as file access speed can be reduced when too many files are in a single directory
# - keys_zone=STATIC:10m defines a shared memory zone for cache keys named “STATIC” and with a size limit of 10MB (which should be more than enough unless you have thousands of files)
# - inactive=7d is the time that items will remain cached without being accessed (7 days), after which they will be removed
# - use_temp_path=off tells NGINX to write files directly to the cache directory and avoid unnecessary copying of data to a temporary storage area first
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=STATIC:10m inactive=7d use_temp_path=off;
upstream nextjs_upstream {
@maullerz
maullerz / index.md
Created August 2, 2022 05:44 — forked from iamakulov/index.md
Proxying api.my-app.com under my-app.com/api, using CloudFront or Cloudflare

Here’s how to make api.my-app.com available under my-app.com/api, using CloudFront or Cloudflare.

CloudFront

If both my-app.com and api.my-app.com are hosted in AWS, you can route requests to these instances using the CloudFront CDN.

Here’s what you’ll need to do:

  1. Create a CloudFront distribution
@maullerz
maullerz / links - writing fast code for react and typescript.md
Created January 26, 2021 10:50 — forked from victor-homyakov/links - writing fast code for react and typescript.md
Ссылки для презентации "Код на React и TypeScript, который работает быстро"
@maullerz
maullerz / Bindings.md
Last active September 30, 2016 14:59
@maullerz
maullerz / # Sublime Emmet JSX Reactjs.md
Created May 10, 2016 12:51 — forked from max-mykhailenko/# Sublime Emmet JSX Reactjs.md
Sublime text 3. Enable Emmet in JSX files with Sublime React plugin

This is no longer needed as Emmet supports JSX - you just need to turn it all on. Did a quick tutorial: http://wesbos.com/emmet-react-jsx-sublime/

Thanks, @wesbos

Problem

  • Using emmet in jsx files
  • Emmet expands text when js autocomplete needed
poweruser@bdx-cc-01:/rest/u/apps/sfk-apps-interactive$ cat /etc/nginx/sites-enabled/sfk*
server {
listen 17100 default_server deferred;
root /rest/u/apps/sfk-apps-interactive/current/public;
access_log /var/log/nginx/sfk-apps-interactive-static-access.log;
error_log /var/log/nginx/sfk-apps-interactive-errors.log;
gzip on;
gzip_comp_level 3;
gzip_proxied expired no-cache no-store private auth;
gzip_disable msie6;