Welcome to the source code of my personal website! I developed this website to archive my favorite projects and write about my thoughts. The initial version in 2011 was written by hand, but I ported it to Jekyll, a static website generator, in 2018, and then to Next.js in 2025. The site uses Twitter’s Bootstrap for mobile/tablet support.
My website is hosted at prateeksahay.com, psahay.com, and ptkinvent.com.
Make sure you have Git LFS installed:
sudo apt install git-lfs
cd website/
git lfs install
With Node installed, run:
npm install
npm run dev
Make sure you have Git LFS installed:
sudo apt install git-lfs
cd website/
git lfs install
With Node installed, run:
npm install
npm run build
npm install -g pm2
pm2 start "npm run start -- -p 8080" --name prateeksahay
With nginx installed, add the following nginx config:
server {
listen 80;
server_name prateeksahay.com www.prateeksahay.com;
rewrite ^ https://$host$request_uri? permanent;
}
server {
listen 443 ssl;
server_name www.prateeksahay.com prateeksahay.com;
index index.html;
root /home/ptkinvent/website;
ssl_certificate /etc/letsencrypt/live/prateeksahay.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/prateeksahay.com/privkey.pem;
location /_next/static {
alias /home/ptkinvent/website/.next/static;
add_header Cache-Control "public, max-age=3600, immutable";
}
location / {
try_files $uri.html $uri/index.html
@public
@nextjs;
add_header Cache-Control "public, max-age=3600";
}
location @public {
add_header Cache-Control "public, max-age=3600";
}
location @nextjs {
# reverse proxy for next server
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
server {
listen 80;
server_name ptkinvent.com www.ptkinvent.com;
rewrite ^ https://$host$request_uri? permanent;
}
server {
listen 443 ssl;
server_name www.ptkinvent.com ptkinvent.com;
index index.html;
root /home/ptkinvent/website;
ssl_certificate /etc/letsencrypt/live/prateeksahay.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/prateeksahay.com/privkey.pem;
location /_next/static {
alias /home/ptkinvent/website/.next/static;
add_header Cache-Control "public, max-age=3600, immutable";
}
location / {
try_files $uri.html $uri/index.html
@public
@nextjs;
add_header Cache-Control "public, max-age=3600";
}
location @public {
add_header Cache-Control "public, max-age=3600";
}
location @nextjs {
# reverse proxy for next server
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
server {
listen 80;
server_name psahay.com www.psahay.com;
rewrite ^ https://$host$request_uri? permanent;
}
server {
listen 443 ssl;
server_name www.psahay.com psahay.com;
index index.html;
root /home/ptkinvent/website;
ssl_certificate /etc/letsencrypt/live/prateeksahay.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/prateeksahay.com/privkey.pem;
location /_next/static {
alias /home/ptkinvent/website/.next/static;
add_header Cache-Control "public, max-age=3600, immutable";
}
location / {
try_files $uri.html $uri/index.html
@public
@nextjs;
add_header Cache-Control "public, max-age=3600";
}
location @public {
add_header Cache-Control "public, max-age=3600";
}
location @nextjs {
# reverse proxy for next server
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
https://medium.com/@jgefroh/a-guide-to-using-nginx-for-static-websites-d96a9d034940