Skip to content

Instantly share code, notes, and snippets.

@prateekkathal
Created May 14, 2025 23:26
Show Gist options
  • Save prateekkathal/e0e44efea8d9db8c5735ec1b029d972b to your computer and use it in GitHub Desktop.
Save prateekkathal/e0e44efea8d9db8c5735ec1b029d972b to your computer and use it in GitHub Desktop.
nginx.conf

Default NGINX configuration for any node.js based project.

server {
  listen 80;
  server_name myapp.com;

  # Max file size
  client_max_body_size 5m;

  # Logs
  access_log /var/log/nginx/myapp.com_access.log;
  error_log /var/log/nginx/myapp.com_error.log;

  location / {
    proxy_read_timeout 300;
    proxy_connect_timeout 300;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Frame-Options SAMEORIGIN;
    proxy_pass http://127.0.0.1:9000;
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment