Skip to content

Instantly share code, notes, and snippets.

@adharshmk96
Last active December 16, 2023 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adharshmk96/12735ea5bb02f763212d23a26bc3d8f0 to your computer and use it in GitHub Desktop.
Save adharshmk96/12735ea5bb02f763212d23a26bc3d8f0 to your computer and use it in GitHub Desktop.
nextjs static generation and hosting
FROM nginx
COPY out /var/www/out
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
server {
listen 80;
server_name acme.com;
root /var/www/out;
location / {
try_files $uri $uri.html $uri/ =404;
}
error_page 404 /404.html;
location = /404.html {
internal;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment