Skip to content

Instantly share code, notes, and snippets.

View mhemrg's full-sized avatar

Mohammad Hossein Ebadollahi mhemrg

View GitHub Profile
@mhemrg
mhemrg / redis.js
Created November 15, 2020 10:23
NodeJS Redis Configuration
const Redis = require("ioredis");
new Redis({
port: process.env.REDIS_PORT,
host: prcess.env.REDIS_HOST,
password: process.env.REDIS_PASSWORD,
});
@mhemrg
mhemrg / liara_nginx.conf
Created November 10, 2020 08:06
Enable GZip in Static Platform
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
location / {
index index.html index.htm;
}
@mhemrg
mhemrg / gist:c86b586d50879446cd7c28baf7edad92
Created November 2, 2020 15:13
Default value for settings in Django
PROJECT_NAME = env('PROJECT_NAME') or 'my-default-value'
session.save_path = "/tmp"
@mhemrg
mhemrg / gist:e32fa342c561ac3b17ec4e1ebae255ad
Created October 24, 2020 10:51
Gatsby - Nginx Configuration
location / {
try_files $uri $uri/index.html =404;
error_page 404 /404.html;
}
"scripts": {
"dev:build-server": "NODE_ENV=development webpack --config webpack.server.js --mode=development -w",
"dev:start": "nodemon ./server-build/index.js",
"start": "node ./server-build/index.js",
"start1": "react-scripts start",
"build": "react-scripts build && npm run dev:build-server",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
'stream' => [
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true,
],
],
dd(env('MAIL_MAILER'), env('MAIL_HOST'), env('MAIL_PORT'), env('MAIL_ENCRYPTION'));
location ^~ /.well-known/ {
root /usr/share/nginx/html;
}
location / {
index index.html index.htm;
}
@mhemrg
mhemrg / gist:72e5d9f544abb1ae75e07d6f433970dd
Created September 25, 2020 09:12
Django + Nginx | Customize max file upload size
location /static {
alias /usr/src/app/staticfiles;
}
location / {
try_files $uri @django_app;
client_max_body_size 10m;
}