Nginx Config Generator
Generate an Nginx server block for a reverse proxy, static site, single page app or PHP, with HTTPS, redirects, gzip and caching.
More options
nginx configuration
Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)
Free Online Nginx Config Generator
Choose what the server should do, enter your domain, and get an Nginx configuration you can paste and test. HTTPS, redirects and sensible defaults are included. It gives developers a quick browser-based way to solve a focused nginx config generator task before moving the result into a project.
How to generate a config
Pick a type (reverse proxy, static site, single page app or PHP), enter the domain and, for a proxy, the address of your app. Copy the result into your Nginx configuration.
Testing it
Run sudo nginx -t. It tells you if the file is valid before you reload the server.
Common mistakes
- Forgetting the semicolon at the end of a directive: Nginx refuses to start and names the line.
- Pointing proxy_pass at a port the app does not listen on, which gives a 502 Bad Gateway.