Skip to content

Instantly share code, notes, and snippets.

View eftakhairul's full-sized avatar
💭
writing code for spaceship :P

Md Eftakhairul Islam eftakhairul

💭
writing code for spaceship :P
View GitHub Profile
@eftakhairul
eftakhairul / nginx_nodejs_app
Last active November 30, 2016 16:38
Basic nginx configuration with nodejs with PM2
server {
listen 80;
server_name abc.com;
location / {
proxy_pass http://localhost:2222;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
@eftakhairul
eftakhairul / nginx-html-app
Created November 14, 2015 07:18
Basic configuration for HTML App
server {
server_name abc.com;
listen 80;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
root /home/app/html-app/dist;
index index.html index.htm;
@eftakhairul
eftakhairul / nginx_redirection
Last active November 30, 2016 16:37
Basic redirection by nginx
server {
server_name abc.com;
return 301 http://xyz.com;
}
@eftakhairul
eftakhairul / apache2_php
Last active November 30, 2016 16:37
Basic apache2 server configuration for php App
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /home/app/php-app
ServerAlias www.abc.com
ServerName abc.com
<Directory /home/app/php-app>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
@eftakhairul
eftakhairul / ngix_html_angular_app
Last active November 30, 2016 16:37
ngix-html-angular-app
server {
server_name staging.io;
listen 80;
access_log /var/log/nginx/staging.io.access.log;
error_log /var/log/nginx/staging.io.error.log;
root /home/app/snap-ui/dist;
index index.html index.htm;
@eftakhairul
eftakhairul / nginx_http_to_https
Last active November 30, 2016 16:32
Forcefully redirect from http to https
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name example.com;
return 301 https://$server_name$request_uri;
}
<VirtualHost *:80>
ServerName example.com
Redirect 301 "/" "https://www.example.com/"
</VirtualHost>
@eftakhairul
eftakhairul / apache2_https
Last active December 19, 2016 18:53
It will work for php and html both
NameVirtualHost *:443
<VirtualHost *:443>
ServerName www.example.com
DocumentRoot /var/www
DirectoryIndex index.php
#DirectoryIndex index.html index.htm
SSLEngine on
SSLCertificateFile /home/ubuntu/.crypto/www_example_com.crt
SSLCertificateKeyFile /home/ubuntu/.crypto/www_example_com.key
@eftakhairul
eftakhairul / file_backup.sh
Last active March 6, 2019 09:58
Dump backup scripts
#!/bin/bash
DB_DIR='file-dumps'
rsync -avz DB_DIR app@ip_address:/home/app/backup
echo "Dump has been synced successfully at $(date)" >> /tmp/dump_cron_log.txt
@eftakhairul
eftakhairul / JS Inheritance Concept
Last active April 29, 2017 15:17
JS Inheritance Concept through prototype
/*
//Literal way
var car = {
color:'black',
make: 'Audi',
model: 'A5',
move: function() {
return 'It is moving';
},